mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
fix: missing colon in event name for dynamic model arguments (#642)
This commit is contained in:
parent
8de3f20221
commit
ad14b2d94a
@ -208,7 +208,7 @@ const buildProps = (path: NodePath<t.JSXElement>, state: State) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateName = isDynamic
|
const updateName = isDynamic
|
||||||
? t.binaryExpression('+', t.stringLiteral('onUpdate'), propName)
|
? t.binaryExpression('+', t.stringLiteral('onUpdate:'), propName)
|
||||||
: t.stringLiteral(
|
: t.stringLiteral(
|
||||||
`onUpdate:${
|
`onUpdate:${
|
||||||
(propName as t.StringLiteral)?.value || 'modelValue'
|
(propName as t.StringLiteral)?.value || 'modelValue'
|
||||||
|
@ -269,7 +269,7 @@ const b = {
|
|||||||
};
|
};
|
||||||
_createVNode(_Fragment, null, [_createVNode(_resolveComponent("A"), {
|
_createVNode(_Fragment, null, [_createVNode(_resolveComponent("A"), {
|
||||||
[foo]: xx,
|
[foo]: xx,
|
||||||
["onUpdate" + foo]: $event => xx = $event
|
["onUpdate:" + foo]: $event => xx = $event
|
||||||
}, null, 16), _createVNode(_resolveComponent("B"), {
|
}, null, 16), _createVNode(_resolveComponent("B"), {
|
||||||
"modelValue": xx,
|
"modelValue": xx,
|
||||||
"modelModifiers": {
|
"modelModifiers": {
|
||||||
@ -281,25 +281,25 @@ _createVNode(_Fragment, null, [_createVNode(_resolveComponent("A"), {
|
|||||||
[foo + "Modifiers"]: {
|
[foo + "Modifiers"]: {
|
||||||
"a": true
|
"a": true
|
||||||
},
|
},
|
||||||
["onUpdate" + foo]: $event => xx = $event
|
["onUpdate:" + foo]: $event => xx = $event
|
||||||
}, null, 16), _createVNode(_resolveComponent("D"), {
|
}, null, 16), _createVNode(_resolveComponent("D"), {
|
||||||
[foo === 'foo' ? 'a' : 'b']: xx,
|
[foo === 'foo' ? 'a' : 'b']: xx,
|
||||||
[(foo === 'foo' ? 'a' : 'b') + "Modifiers"]: {
|
[(foo === 'foo' ? 'a' : 'b') + "Modifiers"]: {
|
||||||
"a": true
|
"a": true
|
||||||
},
|
},
|
||||||
["onUpdate" + (foo === 'foo' ? 'a' : 'b')]: $event => xx = $event
|
["onUpdate:" + (foo === 'foo' ? 'a' : 'b')]: $event => xx = $event
|
||||||
}, null, 16), _createVNode(_resolveComponent("E"), {
|
}, null, 16), _createVNode(_resolveComponent("E"), {
|
||||||
[a()]: xx,
|
[a()]: xx,
|
||||||
[a() + "Modifiers"]: {
|
[a() + "Modifiers"]: {
|
||||||
"a": true
|
"a": true
|
||||||
},
|
},
|
||||||
["onUpdate" + a()]: $event => xx = $event
|
["onUpdate:" + a()]: $event => xx = $event
|
||||||
}, null, 16), _createVNode(_resolveComponent("F"), {
|
}, null, 16), _createVNode(_resolveComponent("F"), {
|
||||||
[b.c]: xx,
|
[b.c]: xx,
|
||||||
[b.c + "Modifiers"]: {
|
[b.c + "Modifiers"]: {
|
||||||
"a": true
|
"a": true
|
||||||
},
|
},
|
||||||
["onUpdate" + b.c]: $event => xx = $event
|
["onUpdate:" + b.c]: $event => xx = $event
|
||||||
}, null, 16)]);"
|
}, null, 16)]);"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user