A brief discussion on the different methods of introducing less, sass and css styles into Vue-cli single file components

亚连
Release: 2018-05-30 16:18:14
Original
2402 people have browsed it

Below I will share with you a brief discussion on the different methods of introducing less, sass, and css styles into Vue-cli single-file components. It has a good reference value and I hope it will be helpful to everyone.

vue-cli has built-in sass and lass configurations. If necessary, just download two modules directly, and webpack will automatically use the appropriate loader to process them based on the lang attribute.

If you need to use sass, install:

npm install node-sass --save-dev npm install sass-loader --save-dev
Copy after login

If you need to use less, install:

npm install less --save-dev npm install less-loader --save-dev
Copy after login

sass’s inline writing:

Copy after login

less’s inline writing:

Copy after login

css’s inline writing:

Copy after login

Sass reference writing:

Copy after login

less reference writing:

Copy after login

css reference writing:

 或者 
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Angular uses the filter uppercase/lowercase to implement letter case conversion function example

Angular uses the operation event command ng -Click to pass multiple parameters example

JavaScript code to implement the upload preview function of txt files

The above is the detailed content of A brief discussion on the different methods of introducing less, sass and css styles into Vue-cli single file components. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn