body{} "; 2. Apply external css file writing, with syntax such as "@import './ index.css'"."/> body{} "; 2. Apply external css file writing, with syntax such as "@import './ index.css'".">

Home >Web Front-end >Vue.js >How to use css in vuejs

How to use css in vuejs

藏色散人
藏色散人Original
2021-09-12 15:07:243488browse

How to use css in vuejs: 1. Directly apply handwritten styles, code such as ""; 2. Apply external css file writing, syntax such as "@import './index.css'".

How to use css in vuejs

The operating environment of this article: Windows 7 system, Vue version 2.9.6, DELL G3 computer.

How to use css in Vue.js?

About the css part

Use sass and less to write css styles in vue-cli. The steps are very simple because vue-cli has already configured sass and less. , we need to use sass or less to directly download the two modules, and then webpack will automatically use the appropriate loader to process them based on the lang attribute. Let’s take a look at how each css should be used

#css

1. Just apply handwritten styles and use css rules. .

2. How to apply external css files

How to use Scss


1. Install the Sass module

2. Use it in the style part of the component Inline writing

3. Writing method of citing sass external files.

How to use Less


1. Install the Less module

2. Use inline writing in the style part of the component

##3. How to quote less external files.

Related recommendations: "

vue.js Tutorial"

The above is the detailed content of How to use css in vuejs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:What is vuejsNext article:What is vuejs