Vue is a simple method for introducing public css files (recommended), vuecss
If you do not want to write css in a single file component, as shown in the following code:
<template> <div id="app"> <div class='nav-box'> <ul class='nav'> <li> <a href="#/" rel="external nofollow" rel="external nofollow" >home</a> </li> <li> <a href="#/odocument" rel="external nofollow" rel="external nofollow" >document</a> </li> <li> <a href="#/about" rel="external nofollow" rel="external nofollow" >about</a> </li> </ul> </div> <router-view></router-view> </div></template><script>export default { name: 'app'}</script><style>#app{ text-align:center; color:#2c3e50; margin-top:60px;}</style>
You can write css styles externally and introduce them using one of the following three methods:
1. introduce it in the main. js file of the portal. Some public style files can be introduced here.
Import Vue from 'vue 'import App from '. /app' // introduce the App component import router from '. /router '/* introduce route configuration */import axios from 'axios 'import' @/assets/css/reset.css'/* introduce public styles */
2 bytes introduced in index.html
<! DOCTYPE html>
3rd is introduced in app.vue, but there is a question in this example. There will be an empty header in index.html.
<Template> <div id = "app"> <div class = 'nav-box'> <ul class = 'nav'> <li> <a href = "#/" rel = "external nofollow" rel = "external nofollow"> home </a> </li> <a href = "#/odocument" rel = "external nofollow" rel = "external nofollow"> document </a> </li> <a href = "#/about" rel = "external nofollow" rel = "external nofollow"> about </a> </li> </ul> </div> <router-view> </div> </template> <script> export default {name: 'app'} </script> <style> @ import '. /assets/css/reset.css ';/* introduce public styles */</style>
The simple method (recommended) for introducing public css files in the above vue is all the content shared by Alibaba Cloud xiaobian. I hope you can give us a reference and provide more support to the customer's house.