编写一个全局css文件,然后再App.vue的style中引用:
1.在assets下新建一个css文件夹,编写一个全局css文件:

2.在App.vue中引用该全局css:
方法二:
- <style lang="less">
- @import './assets/css/index.css'; //引用全局css
- #app {
- height: 100%;
- width: 100%;
- }
- </style>
第一步同上,创建全局css文件,然后直接在main.js中引入全局css

方法三:
直接在index.html中设置style:

文章点评