1. 程式人生 > >vue 引入通用 css

vue 引入通用 css

組件 oba outer style 路由配置 smart rom eight css

1、在入口 js 文件 main.js 中引入,一些公共的樣式文件,可以在這裏引入。

import Vue from ‘vue‘
import App from ‘./App‘ // 引入App這個組件
import router from ‘./router‘ /* 引入路由配置 */
import axios from ‘axios‘
import ‘../static/css/global.css‘ /*引入公共樣式*/

2、在 index.html 中引入,這個不說了;

3、在 app.vue 中引入,但是這樣引入有一個問題,就是在 index.html 的 HEADH 上會多出一個空的<style></style>

<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: app
}
</script>

<style>
  @import ‘./../static/css/global.css‘; /*引入公共樣式*/

</style>

轉載:

vue 引入公共css文件

vue 引入通用 css