fix(compiler-core): pick last char when dynamic directive doesn't close (#4507)

This commit is contained in:
Herrington Darkholme 2021-09-07 23:36:37 +08:00 committed by GitHub
parent 1c4f0f0afd
commit 5d262e08d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -6260,7 +6260,7 @@ Object {
Object { Object {
"arg": Object { "arg": Object {
"constType": 0, "constType": 0,
"content": "se", "content": "sef",
"isStatic": false, "isStatic": false,
"loc": Object { "loc": Object {
"end": Object { "end": Object {

View File

@ -814,9 +814,10 @@ function parseAttribute(
context, context,
ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END
) )
} content = content.substr(1)
} else {
content = content.substr(1, content.length - 2) content = content.substr(1, content.length - 2)
}
} else if (isSlot) { } else if (isSlot) {
// #1241 special case for v-slot: vuetify relies extensively on slot // #1241 special case for v-slot: vuetify relies extensively on slot
// names containing dots. v-slot doesn't have any modifiers and Vue 2.x // names containing dots. v-slot doesn't have any modifiers and Vue 2.x