isCoreComponent,
isSimpleIdentifier,
isStaticArgOf,
+ isVPre,
} from './utils'
import { decodeHTML } from 'entities/lib/decode.js'
import {
ondirarg(start, end) {
if (start === end) return
const arg = getSlice(start, end)
- if (inVPre) {
+ if (inVPre && !isVPre(currentProp!)) {
;(currentProp as AttributeNode).name += arg
setLocEnd((currentProp as AttributeNode).nameLoc, end)
} else {
ondirmodifier(start, end) {
const mod = getSlice(start, end)
- if (inVPre) {
+ if (inVPre && !isVPre(currentProp!)) {
;(currentProp as AttributeNode).name += '.' + mod
setLocEnd((currentProp as AttributeNode).nameLoc, end)
} else if ((currentProp as DirectiveNode).name === 'slot') {
return node.type === NodeTypes.INTERPOLATION || node.type === NodeTypes.TEXT
}
+export function isVPre(p: ElementNode['props'][0]): p is DirectiveNode {
+ return p.type === NodeTypes.DIRECTIVE && p.name === 'pre'
+}
+
export function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode {
return p.type === NodeTypes.DIRECTIVE && p.name === 'slot'
}