File tree 2 files changed +5
-3
lines changed
compiler-dom/src/directives 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,21 +17,22 @@ export function compile(
17
17
template : string | RootNode ,
18
18
options : CompilerOptions = { }
19
19
) : CodegenResult {
20
- if ( __BROWSER__ && options . prefixIdentifiers ) {
20
+ if ( __BROWSER__ && options . prefixIdentifiers === false ) {
21
21
; ( options . onError || defaultOnError ) (
22
22
createCompilerError ( ErrorCodes . X_PREFIX_ID_NOT_SUPPORTED )
23
23
)
24
24
}
25
25
26
26
const ast = isString ( template ) ? parse ( template , options ) : template
27
27
28
+ const prefixIdentifiers = ! __BROWSER__ && options . prefixIdentifiers === true
28
29
transform ( ast , {
29
30
...options ,
30
- prefixIdentifiers : ! __BROWSER__ && options . prefixIdentifiers === true ,
31
+ prefixIdentifiers,
31
32
nodeTransforms : [
32
33
transformIf ,
33
34
transformFor ,
34
- transformExpression ,
35
+ ... ( prefixIdentifiers ? [ transformExpression ] : [ ] ) ,
35
36
transformElement ,
36
37
...( options . nodeTransforms || [ ] ) // user transforms
37
38
] ,
@@ -41,6 +42,7 @@ export function compile(
41
42
...( options . directiveTransforms || { } ) // user transforms
42
43
}
43
44
} )
45
+
44
46
return generate ( ast , options )
45
47
}
46
48
File renamed without changes.
You can’t perform that action at this time.
0 commit comments