Skip to content

Commit 4685dac

Browse files
committed
fix(compiler-core): improve handling of v-bind shorthand for in-DOM templates
1 parent 5a8aa0b commit 4685dac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/compiler-core/src/transforms/transformVBindShorthand.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export const transformVBindShorthand: NodeTransform = (node, context) => {
1515
if (
1616
prop.type === NodeTypes.DIRECTIVE &&
1717
prop.name === 'bind' &&
18-
!prop.exp
18+
(!prop.exp ||
19+
// #13930 :foo will be processed as :foo="" in in-DOM template
20+
(__BROWSER__ &&
21+
prop.exp.type === NodeTypes.SIMPLE_EXPRESSION &&
22+
!prop.exp.isStatic &&
23+
!prop.exp.content))
1924
) {
2025
const arg = prop.arg!
2126
if (arg.type !== NodeTypes.SIMPLE_EXPRESSION || !arg.isStatic) {

0 commit comments

Comments
 (0)