Below I will share with you a simple method (recommended) for introducing public css files into vue. It has a good reference value and I hope it will be helpful to everyone.
If you don’t want to write the css in a single file component like this:
You can write the css style in Externally, introduce it through one of the following three methods:
1. Introduce it in the entry js file main.js. Some public style files can be found here. Introduction.
import Vue from 'vue' import App from './App' // 引入App这个组件 import router from './router' /* 引入路由配置 */ import axios from 'axios' import '@/assets/css/reset.css'/*引入公共样式*/
2. Introduce it into index.html
3. Introduce it into app.vue, but there is a problem with this introduction. There will be an extra empty
on the HEADH of index.html. The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to use http module in node.js
How to use js to invoke App in WeChat?
node packaging tool Pkg (detailed tutorial)
How to integrate zTree code in Angular
classListHow to implement two button style switching
The above is the detailed content of How to introduce public css files through vue. For more information, please follow other related articles on the PHP Chinese website!