diff --git a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap index d14631367cb..d7ac9888a59 100644 --- a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap @@ -6260,7 +6260,7 @@ Object { Object { "arg": Object { "constType": 0, - "content": "se", + "content": "sef", "isStatic": false, "loc": Object { "end": Object { diff --git a/packages/compiler-core/src/parse.ts b/packages/compiler-core/src/parse.ts index 907e54d742e..fd31f17aee7 100644 --- a/packages/compiler-core/src/parse.ts +++ b/packages/compiler-core/src/parse.ts @@ -814,9 +814,10 @@ function parseAttribute( context, 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) { // #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