wip(compiler-ssr): v-model static types + textarea
This commit is contained in:
@@ -56,11 +56,7 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
|
||||
// "onUpdate:modelValue": $event => (foo = $event)
|
||||
createObjectProperty(
|
||||
eventName,
|
||||
createCompoundExpression([
|
||||
`$event => (`,
|
||||
...(exp.type === NodeTypes.SIMPLE_EXPRESSION ? [exp] : exp.children),
|
||||
` = $event)`
|
||||
])
|
||||
createCompoundExpression([`$event => (`, exp, ` = $event)`])
|
||||
)
|
||||
]
|
||||
|
||||
@@ -82,12 +78,7 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
|
||||
const modifiersKey = arg
|
||||
? arg.type === NodeTypes.SIMPLE_EXPRESSION && arg.isStatic
|
||||
? `${arg.content}Modifiers`
|
||||
: createCompoundExpression([
|
||||
...(arg.type === NodeTypes.SIMPLE_EXPRESSION
|
||||
? [arg]
|
||||
: arg.children),
|
||||
' + "Modifiers"'
|
||||
])
|
||||
: createCompoundExpression([arg, ' + "Modifiers"'])
|
||||
: `modelModifiers`
|
||||
props.push(
|
||||
createObjectProperty(
|
||||
|
||||
@@ -87,7 +87,7 @@ export const transformOn: DirectiveTransform = (
|
||||
// wrap inline statement in a function expression
|
||||
exp = createCompoundExpression([
|
||||
`$event => ${hasMultipleStatements ? `{` : `(`}`,
|
||||
...(exp.type === NodeTypes.SIMPLE_EXPRESSION ? [exp] : exp.children),
|
||||
exp,
|
||||
hasMultipleStatements ? `}` : `)`
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user