File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/compiler-core/src Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {
43
43
isCoreComponent ,
44
44
isSimpleIdentifier ,
45
45
isStaticArgOf ,
46
+ isVPre ,
46
47
} from './utils'
47
48
import { decodeHTML } from 'entities/lib/decode.js'
48
49
import {
@@ -246,7 +247,7 @@ const tokenizer = new Tokenizer(stack, {
246
247
ondirarg ( start , end ) {
247
248
if ( start === end ) return
248
249
const arg = getSlice ( start , end )
249
- if ( inVPre ) {
250
+ if ( inVPre && ! isVPre ( currentProp ! ) ) {
250
251
; ( currentProp as AttributeNode ) . name += arg
251
252
setLocEnd ( ( currentProp as AttributeNode ) . nameLoc , end )
252
253
} else {
@@ -262,7 +263,7 @@ const tokenizer = new Tokenizer(stack, {
262
263
263
264
ondirmodifier ( start , end ) {
264
265
const mod = getSlice ( start , end )
265
- if ( inVPre ) {
266
+ if ( inVPre && ! isVPre ( currentProp ! ) ) {
266
267
; ( currentProp as AttributeNode ) . name += '.' + mod
267
268
setLocEnd ( ( currentProp as AttributeNode ) . nameLoc , end )
268
269
} else if ( ( currentProp as DirectiveNode ) . name === 'slot' ) {
Original file line number Diff line number Diff line change @@ -343,6 +343,10 @@ export function isText(
343
343
return node . type === NodeTypes . INTERPOLATION || node . type === NodeTypes . TEXT
344
344
}
345
345
346
+ export function isVPre ( p : ElementNode [ 'props' ] [ 0 ] ) : p is DirectiveNode {
347
+ return p . type === NodeTypes . DIRECTIVE && p . name === 'pre'
348
+ }
349
+
346
350
export function isVSlot ( p : ElementNode [ 'props' ] [ 0 ] ) : p is DirectiveNode {
347
351
return p . type === NodeTypes . DIRECTIVE && p . name === 'slot'
348
352
}
You can’t perform that action at this time.
0 commit comments