Warning: file_put_contents(/datas/wwwroot/jiajiahui/core/caches/caches_template/2/default/show.php): failed to open stream: Permission denied in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 55

Warning: chmod(): Operation not permitted in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 56
vue中引入icomoon彩色图标,stylus文件 - 源码之家

vue中引入icomoon彩色图标,stylus文件

  1. 在iconmoon中preferences选择Stylus。vue中引入icomoon彩色图标,stylus文件
  2. 点击download,解压后有以下文件。
    vue中引入icomoon彩色图标,stylus文件
  3. 将fonts文件夹复制到src目录下common中。并在common目录中添加stylus文件夹。将style.styl文件和variables.styl文件复制进去。(可将style.styl改为icon.styl)我的项目目录如下:
    vue中引入icomoon彩色图标,stylus文件
  4. 更改variables.styl中icomoon-font-path ?= “…/fonts” 路径为fonts所在的路径。
  5. 在main.js中引入import “./common/stylus/icon.styl”;
  6. 完成后在项目中引用图标。
<template>
  <div id="app">
    <div>
      <span class="icon-bili">
        <span class="path1"></span>
        <span class="path2"></span>
      </span>
      <span>icon-bili</span>
    </div>
  </div>
</template>
<style lang="stylus">
</style>
  1. 结果如下:
    vue中引入icomoon彩色图标,stylus文件