Skip to content

Commit 5d262e0

Browse files
fix(compiler-core): pick last char when dynamic directive doesn't close (#4507)
1 parent 1c4f0f0 commit 5d262e0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -6260,7 +6260,7 @@ Object {
62606260
Object {
62616261
"arg": Object {
62626262
"constType": 0,
6263-
"content": "se",
6263+
"content": "sef",
62646264
"isStatic": false,
62656265
"loc": Object {
62666266
"end": Object {

packages/compiler-core/src/parse.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,10 @@ function parseAttribute(
814814
context,
815815
ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END
816816
)
817+
content = content.substr(1)
818+
} else {
819+
content = content.substr(1, content.length - 2)
817820
}
818-
819-
content = content.substr(1, content.length - 2)
820821
} else if (isSlot) {
821822
// #1241 special case for v-slot: vuetify relies extensively on slot
822823
// names containing dots. v-slot doesn't have any modifiers and Vue 2.x

0 commit comments

Comments
 (0)