vue项目中使用less
1.安装less less-loader
npm i -D less less-loader
2.在 .vue文件中使用lang="less"和@import
// home.lessc @base-color: #39c; @part-color: #3c9;
<style lang="less"> @import ‘./home.less‘; .triangle { width: 0; height: 0; margin: 20px; border: 40px solid; border-color: @base-color transparent transparent transparent; } </style>
或者直接在该.vue的style中声明自定义样式:
<style lang="less"> @base-color: #39c; .triangle { width: 0; height: 0; margin: 20px; border: 40px solid; border-color: @base-color transparent transparent transparent; } </style>
相关推荐
yuzhu 2020-11-16
85477104 2020-11-17
KANSYOUKYOU 2020-11-16
sjcheck 2020-11-03
怪我瞎 2020-10-28
源码zanqunet 2020-10-28
gloria0 2020-10-26
王军强 2020-10-21
学习web前端 2020-09-28
QiaoranC 2020-09-25
anchongnanzi 2020-09-21
安卓猴 2020-09-12
Macuroon 2020-09-11
kiven 2020-09-11
LittleCoder 2020-09-11
Cheetahcubs 2020-09-13
小焊猪web前端 2020-09-10
颤抖吧腿子 2020-09-04
softwear 2020-08-21