v- without directive name accidentally parsed as v-slot
Version
3.2.7
Reproduction link
vue-next-template-explorer.netlify.app
Steps to reproduce
Input code like <template v->123</template>
in template explorer or sfc playground.
What is expected?
Vue should report missing directive name error and treat v-
as a plain attribute.
What is actually happening?
v-
is parsed as v-slot
.
It's probably an implementation specific behavior. When the regex v-
matches nothing, vue fallbacks to slot
https://github.com/vuejs/vue-next/blob/master/packages/compiler-core/src/parse.ts#L779-L791