An open API service indexing awesome lists of open source software.

https://github.com/iirving/vue-sfc-async-loader

Vue 3 demo with a asynchronously loaded component in a single file component
https://github.com/iirving/vue-sfc-async-loader

javascript vite vue vue3

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Compile and Minify for Production

```sh
npm run build
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```