/vue-sfc-async-loader

Vue 3 demo with a asynchronously loaded component in a single file component

Primary LanguageVue

vue-sfc-async-loader

Vue 3 in Vite.

Asynchronously Loaded Component

The defineAsyncComponent function is used to import the BigYellowUserName component asynchronously, in other words not synchronously with the other ellemnts on the page. The loading state is controled by the showUserName value and the toogle button.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Compile and Minify for Production

npm run build

Lint with ESLint

npm run lint