feat(compiler-core): support aliasing vue: prefixed events to inline vnode hooks
This commit is contained in:
@@ -550,7 +550,7 @@ export function buildProps(
|
||||
(isVBind && isStaticArgOf(arg, 'key')) ||
|
||||
// inline before-update hooks need to force block so that it is invoked
|
||||
// before children
|
||||
(isVOn && hasChildren && isStaticArgOf(arg, 'vnodeBeforeUpdate', true))
|
||||
(isVOn && hasChildren && isStaticArgOf(arg, 'vue:before-update'))
|
||||
) {
|
||||
shouldUseBlock = true
|
||||
}
|
||||
|
||||
@@ -42,7 +42,11 @@ export const transformOn: DirectiveTransform = (
|
||||
let eventName: ExpressionNode
|
||||
if (arg.type === NodeTypes.SIMPLE_EXPRESSION) {
|
||||
if (arg.isStatic) {
|
||||
const rawName = arg.content
|
||||
let rawName = arg.content
|
||||
// TODO deprecate @vnodeXXX usage
|
||||
if (rawName.startsWith('vue:')) {
|
||||
rawName = `vnode-${rawName.slice(4)}`
|
||||
}
|
||||
// for all event listeners, auto convert it to camelCase. See issue #2249
|
||||
eventName = createSimpleExpression(
|
||||
toHandlerKey(camelize(rawName)),
|
||||
|
||||
Reference in New Issue
Block a user