Extending the vue script setup syntactic sugar, by vite-plugin-vue-setup-extend
npm install vite-plugin-vue-setup-extend-plusExpansion based on vite-plugin-vue-setup-extend
Make the vue script setup syntax support the name attribute
- Automatically convert based on name and inheritAttrs
- support name
- support inheritAttrs
- precise breakpoints
node version: >=12.0.0
vite version: >=2.0.0
``bash`
yarn add vite-plugin-vue-setup-extend-plus -D
or
`bash`
npm i vite-plugin-vue-setup-extend-plus -D
- 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-plus'
export default defineConfig({
plugins: [vue(), vueSetupExtend()],
})
`
- SFC
`html
hello world {{ a }}
``
MIT