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 {
4343 isCoreComponent ,
4444 isSimpleIdentifier ,
4545 isStaticArgOf ,
46+ isVPre ,
4647} from './utils'
4748import { decodeHTML } from 'entities/lib/decode.js'
4849import {
@@ -246,7 +247,7 @@ const tokenizer = new Tokenizer(stack, {
246247 ondirarg ( start , end ) {
247248 if ( start === end ) return
248249 const arg = getSlice ( start , end )
249- if ( inVPre ) {
250+ if ( inVPre && ! isVPre ( currentProp ! ) ) {
250251 ; ( currentProp as AttributeNode ) . name += arg
251252 setLocEnd ( ( currentProp as AttributeNode ) . nameLoc , end )
252253 } else {
@@ -262,7 +263,7 @@ const tokenizer = new Tokenizer(stack, {
262263
263264 ondirmodifier ( start , end ) {
264265 const mod = getSlice ( start , end )
265- if ( inVPre ) {
266+ if ( inVPre && ! isVPre ( currentProp ! ) ) {
266267 ; ( currentProp as AttributeNode ) . name += '.' + mod
267268 setLocEnd ( ( currentProp as AttributeNode ) . nameLoc , end )
268269 } else if ( ( currentProp as DirectiveNode ) . name === 'slot' ) {
Original file line number Diff line number Diff line change @@ -343,6 +343,10 @@ export function isText(
343343 return node . type === NodeTypes . INTERPOLATION || node . type === NodeTypes . TEXT
344344}
345345
346+ export function isVPre ( p : ElementNode [ 'props' ] [ 0 ] ) : p is DirectiveNode {
347+ return p . type === NodeTypes . DIRECTIVE && p . name === 'pre'
348+ }
349+
346350export function isVSlot ( p : ElementNode [ 'props' ] [ 0 ] ) : p is DirectiveNode {
347351 return p . type === NodeTypes . DIRECTIVE && p . name === 'slot'
348352}
You can’t perform that action at this time.
0 commit comments