图标字体是以html代码的形式在网页中画小图标,使用图标字体的优点:css
iconfont.svg
文件,致使我按照demo_index里面的方式使用时会出错,一时也没找到解决办法,最后仍是选择已引入在线代码的形式使用。
// index.html
<link rel="stylesheet" href="http://at.alicdn.com/t/font_1150089_yea3uhmttwc.css">
//要使用的地方
<span class="iconfont icon-xxx">
复制代码
stylus是css的一个预处理器,能够更方便的编写css代码。html
npm i -D stylus stylus-loader
// 1. 将.vue中的style标识为stylus
// xxx.vue
<template></template>
<script></script>
//标识
<style lang="stylus" type="stylesheet/stylus" scope>
//scope表明这里的样式只做用在此处,不会应用到其余vue文件中
</style>
// 2. 直接建立后缀为.stylus的文件,而后在使用的地方导入便可
复制代码