https://github.com/vbenjs/vite-plugin-vue-setup-extend
Extending the vue script setup syntactic sugar
https://github.com/vbenjs/vite-plugin-vue-setup-extend
Last synced: about 1 year ago
JSON representation
Extending the vue script setup syntactic sugar
- Host: GitHub
- URL: https://github.com/vbenjs/vite-plugin-vue-setup-extend
- Owner: vbenjs
- License: mit
- Created: 2021-08-25T13:59:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-18T07:02:04.000Z (about 4 years ago)
- Last Synced: 2024-12-24T09:06:17.719Z (over 1 year ago)
- Language: TypeScript
- Size: 181 KB
- Stars: 152
- Watchers: 4
- Forks: 19
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-vue-setup-name-support
Make the vue script setup syntax support the name attribute
## Install (yarn or npm)
**node version:** >=12.0.0
**vite version:** >=2.0.0
```bash
yarn add vite-plugin-vue-setup-extend -D
```
or
```bash
npm i vite-plugin-vue-setup-extend -D
```
## Usage
- Config plugin in vite.config.ts. In this way, the required functions can be introduced as needed
```ts
import { defineConfig, Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
export default defineConfig({
plugins: [vue(), vueSetupExtend()],
})
```
- SFC
```html
hello world {{ a }}
const a = 1
```
## Sample project
[Vben Admin](https://github.com/anncwb/vue-vben-admin)
## License
MIT