❓在项目中统一配置UI主题色,各个组件配色统一修改
- vantUI按需安装
参考vantUI文档
- 创建vantVar.less文件夹进行样式编写
vantVar.less
:root:root{
//导航
--van-nav-bar-height: 44px;
//按钮
--van-button-primary-color: #ffffff;
--van-button-primary-background: rgba(86, 61, 248, 1);
}
- config.js中配置
import {VantResolver} from 'unplugin-vue-components/resolvers';
vite: {
plugins: [
vue(),
Components({
resolvers: [VantResolver()],
}),
],
...others
}
- 每一个组件都提供样式变量可进行配置