vue中引入css的几种方式

1、在main.js中引入

import 'common/stylus/index.styl'

或者

import '@/common/stylus/index.styl'

2、在.vue文件中

@import '../../common/stylus/mixin.styl';

3、在index.html中引入

注:
1.在config目录下的 index.js 里面说明了index.html需要引用的静态资源路径
2.必须放在static目录下面才能引用到

在这里插入图片描述
引用

<link rel="stylesheet" href="./static/css/reset.css"/>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42645716/article/details/112968186
今日推荐