zl程序教程

您现在的位置是:首页 >  前端

当前栏目

vue中引入css的几种方式

VueCSS 方式 几种 引入
2023-09-11 14:19:17 时间

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"/>

在这里插入图片描述