Use `defineComponent()` and a single root template element in App.vue, as Vetur complains
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).
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: () =>
:
Same example with long-form return
: