unplugin-vue-armor
v0.0.5
Published
🛸Vue macros that provide additional attributes to vue elements.🛸为Vue标签提供更多属性的宏插件
Downloads
1
Readme
unplugin-vue-armor
🛸Vue macros that provide additional attributes to vue elements.🛸为Vue标签提供更多属性的宏插件
📦Installation
#npm
npm i unplugin-vue-armor -D
#yarn
yarn add unplugin-vue-armor -D
#pnpm
pnpm i unplugin-vue-armor -D
// vite.config.ts
import Armor from 'unplugin-vue-armor/vite'
export default defineConfig({
plugins: [
Armor(),
],
})
// rollup.config.js
import Armor from 'unplugin-vue-armor/rollup'
export default {
plugins: [
Armor(),
],
}
// webpack.config.js
module.exports = {
plugins: [
require('unplugin-vue-armor/webpack')(),
],
}
🔮Usage
name:
If you just need create component name in set up, you can try to use
name
to replacedefineOptions
,only can be used in Vue >= 3.3.It will automatically turn this
<script setup name="VueArmor"></script>
into this
<script setup> defineOptions({ name: "VueArmor" }) </script>
style:
Use
style
to import your scoped css, make your code more concise.It will automatically turn this
<script setup style="./styles/index.css"></script>
into this
<script setup></script> <style scoped src="./styles/index.css"></style>