内置vclass指令,自动生成全局css,不用再写css
What problem does this feature solve?
前端项目中有非常多的样式其实是重复的,可以通过添加新的指令,在编译代码时自动生成全局的css;开发人员甚至可以不用再写css,编译后生成全局的css,相同的属性只会生成一条css,进一步缩小vue项目的打包大小
What does the proposed API look like?
<div v-class="pd-10 fs-20 fw-700"></div>
自动生成global.css
.pd-10 { padding: 10px; }
.fs { font-size: 20px }
.fw-700 { font-weight: 700 }
maybe you can use windicss
. vite has corresponding plugin vite-plugin-windicss