Subscribe on changes!

Use `defineComponent()` and a single root template element in App.vue, as Vetur complains

avatar
May 11th 2020

Is your feature request related to a problem? Please describe.

The default App.vue returned by the create-vite-app command on both npx and yarn create causes Vetur to complain about improper type-signature without defineComponent(), and contains multiple root elements (this second one may or may not be a valid concern).

image

Describe the solution you'd like Wrap the content in a single root element, like <div>, and use defineComponent() so that Vetur validates the component types.

Also, either: A) Use the long-form data() with explicit return { }, because Vetur does not correctly detect invalid props with data: () => ({}) B) Use Vue 3 setup() which may be better

Example of invalid type-checking with data: () =>:

image

Same example with long-form return:

image

avatar
May 11th 2020

Vetur hasn't been fully updated for Vue 3 yet.