mirror of https://github.com/vuejs/core.git
fix(compiler-core): improve handling of v-bind shorthand for in-DOM templates
This commit is contained in:
parent
5a8aa0b2ba
commit
4685dac18f
|
@ -15,7 +15,12 @@ export const transformVBindShorthand: NodeTransform = (node, context) => {
|
||||||
if (
|
if (
|
||||||
prop.type === NodeTypes.DIRECTIVE &&
|
prop.type === NodeTypes.DIRECTIVE &&
|
||||||
prop.name === 'bind' &&
|
prop.name === 'bind' &&
|
||||||
!prop.exp
|
(!prop.exp ||
|
||||||
|
// #13930 :foo will be processed as :foo="" in in-DOM template
|
||||||
|
(__BROWSER__ &&
|
||||||
|
prop.exp.type === NodeTypes.SIMPLE_EXPRESSION &&
|
||||||
|
!prop.exp.isStatic &&
|
||||||
|
!prop.exp.content))
|
||||||
) {
|
) {
|
||||||
const arg = prop.arg!
|
const arg = prop.arg!
|
||||||
if (arg.type !== NodeTypes.SIMPLE_EXPRESSION || !arg.isStatic) {
|
if (arg.type !== NodeTypes.SIMPLE_EXPRESSION || !arg.isStatic) {
|
||||||
|
|
Loading…
Reference in New Issue