Skip to content

Commit 2d63fa5

Browse files
gguoyuopen-hippy
authored andcommitted
fix(vue-next): fix element do not use beforeLoadStyle hooks issue (#3339)
Co-authored-by: OpenHippy <[email protected]>
1 parent dfe30bf commit 2d63fa5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/hippy-vue-next/src/runtime/element/hippy-element.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
isStyleMatched,
4040
whitespaceFilter,
4141
getBeforeRenderToNative,
42+
getBeforeLoadStyle,
4243
} from '../../util';
4344
import { isRTL } from '../../util/i18n';
4445
import { EventMethod } from '../../util/event';
@@ -203,6 +204,9 @@ export class HippyElement extends HippyNode {
203204
// additional processing of properties
204205
public filterAttribute?: CallbackType;
205206

207+
// style preprocessor
208+
public beforeLoadStyle: CallbackType;
209+
206210
// polyFill of native event
207211
protected polyfillNativeEvents?: (
208212
method: string,
@@ -226,13 +230,11 @@ export class HippyElement extends HippyNode {
226230
this.classList = new Set();
227231
this.attributes = {};
228232
this.style = {};
233+
this.beforeLoadStyle = getBeforeLoadStyle();
229234
// hack special problems
230235
this.hackSpecialIssue();
231236
}
232237

233-
// style preprocessor
234-
public beforeLoadStyle: CallbackType = val => val;
235-
236238
/**
237239
* get component info
238240
*/

0 commit comments

Comments
 (0)