[Solved] Vue3 vetur error: has no default export component is not exported

Vscode plug-in vetur reports an error: it says that the component is useless to throw,

Two components are written in two ways: options API and script setup

My component writing method is vue3’s syntax sugar script setup

Reason: after data query, vehicle (v0.35.0) does not support ts


1) Replace the syntax highlighting plug-in volar that supports ts to replace vetur (this method is recommended)

2) Use options API instead of script setup syntax (not recommended)

Similar Posts: