This article mainly introduces a simple tutorial for using less in vue2. Since there is no need to manually configure webpack, using less in vue is very simple. You only need to install less and less-loadder.
First of all, let me explain that if the project is created usingnpm init webpack
project name, there is no need to manually configure webpack
, so using less in vue is very simple, you only need to install less , less-loader will do.
Steps
npm install less less-loader --save //将less和less-loader安装到开发依赖 npm run dev
If the installation is successful, you can use less in the vue component