(1)安装Less模块:

npm install less

 

(2)安装less和less-loader,命令如下

 npm install less less-loader --sava-dev

 

(3)打开build/webpack.base.conf.js,在module.exports 对象中添加依赖

   module.exports = {

        module: {

            rules: [

                {

                    test: /\.less$/,

                    loader: "style-loader!css-loader!less-loader"    

                }

            ]

        }

 

(4)代码中的style标签中加上 lang="less" 就可以使用了

<style scoped lang="less">

</style>

 

 

 

 

.