0.1.2 • Published 1 year ago

bito-icons v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

bito-icons

BITO SVG ICONS 统一管理仓库,用于BITO云宇宙所有前端管理系统。

npm发布步骤

  • 注册 npm 账号
  • 在terminal中执行:npm login,然后输入账号、密码、邮箱来登录
  • npm publish(如果是更新后重新发布,请先修改 package.json 中的 version 号)

在云宇宙系列前端中引入 bito-icons 的步骤

删除下列文件夹

删除该文件夹

安装

npm i bito-icons@latest

在 main.js 中修改引入

// 删除旧版引入方式:
// import './assets/icons'
// 修改为新版引入方式:
import SvgIcon from '@/components/SvgIcon'// svg component
Vue.component('SvgIcon', SvgIcon) // 全局组件挂载
import 'bito-icons'

在 main.js 中修改引入

在 vue.config.js 中修改svg路径

    config.module
      .rule('svg')
      .exclude.add(/[\\/]node_modules[\\/]_?bito-icons(.*)/)
      .end()
    config.module
      .rule('icons')
      .test(/\.svg$/)
      .include.add(/[\\/]node_modules[\\/]_?bito-icons(.*)/)
      .end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({
        symbolId: 'icon-[name]'
      })
      .end()

在 vue.config.js 中修改svg路径

重启BITO云宇宙的前端服务

npm run dev