body{} "; 2. Apply external css file writing, with syntax such as "@import './ index.css'"."> How to use css in vuejs-Vue.js-php.cn
Home> Web Front-end> Vue.js> body text

How to use css in vuejs

藏色散人
Release: 2023-01-13 00:45:31
Original
3359 people have browsed it

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!

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!