-
-
Notifications
You must be signed in to change notification settings - Fork 6
Vue 2 template support #35
Comments
Thanks for the suggestion. But vue-tsc only report the TS problems, template problems report by vue compiler (vue-cli / vite) not by vue-tsc, so you can just ignore it. Vue 2 template check may be supported by Plugin API. |
@johnsoncodehk I have now also some parts like this: Is there an option to just say e.g. |
You can use
And the problem is if you use You can define v-chip(v-for="synonym in item.synonyms", ...)
template(v-if="synonym.entity")
- ... Note: vetur's eslint also report that don't use |
I know the breaking change. But using |
Is this better for you? template(v-for="synonym in item.synonyms")
v-chip(v-if="synonym.entity", ...)
- ... |
Sadly not, cause this would just move the error to the template(v-for="synonym in item.synonyms")
v-chip(v-if="synonym.entity", :key="synonym.id" ...)
~~~~~~~~~~~~~~~~~ <template v-for> key should be placed on the <template> tag. vue(32)
- ... Letting me asked again to tell the compiler somehow to just ignore it, cause I know I'm using Vue 2 😅 |
A good news is Vue 3.1 template compiler is available to Vue 2! https://blog.ninja-squad.com/2021/06/07/what-is-new-vue-3.1/ |
Please track vuejs/language-tools#346 |
Now that we have compat mode 2, could we add the Currently I'm applying this patch via patch-package to suppress build errors. diff --git a/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts b/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
index f183ace..2d3b617 100644
--- a/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
+++ b/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
@@ -1398,7 +1398,8 @@ type EventHandlers<E> = {
import * as RuntimeCore from '@vue/runtime-core'
type ReservedProps = {
- key?: string | number
+ // https://github.com/johnsoncodehk/vue-tsc/issues/35#issue-901304468
+ key?: string | number | symbol
ref?:
| string
| RuntimeCore.Ref |
It seem 3.2.0-beta.8 already fixed it. |
I want to use vue-tsc with currently a Vue 2 project due to I'm stuck on Vuetify
But sadly I get errors like
<template v-for> key should be placed on the <template> tag. vue(32)
https://v3.vuejs.org/guide/migration/key-attribute.html#overview
This is correct for Vue 3, but not for Vue 2. Is it possible somehow to use a
--vue=2
mode to prevent/suppress such errors?De we need to report that to
Volar
instead ofvue-tsc
?The text was updated successfully, but these errors were encountered: