vue 引用less的方法
vue中使用less
首先vue开发环境已经安装成功
当所有东西都 准备好之后 :
第一步:
安装less依赖,npm install less less-loader --save
第二步:
安装less依赖,npm install -g less
第三步:
main.js 全局引入
var Less = require('Less');
第四步:
在组件中
<style scoped lang="less">
@width: 100%;
@height: 100px;
@color: red;
.container{
width: @width;
height: @height;
background-color: @color;
margin-bottom: 5px;
};
</style>