智慧职教图谱样式组件
npm install zhzj_graph_com
import GeneralAtlas from "zhzj_graph_com" import "zhzj_graph_com/dist/zhzj_graph_com.css"
全局引入 Vue.use(GeneralAtlas) 按需可在页面内引入
npm install
npm run build:com
npm网站注册账号(是否使用公司账号?) npm
(如果设置了淘宝镜像,会登录不成功,要将镜像改为npm官方镜像 npm config set registry https://registry.npmjs.org 查看镜像 npm config get registry)
npm login
npm publish
在 npm login
时,报错 Unexpected token < in JSON at position 0 while parsing near '<!DOCTYPE HTML PUBLI...'
原因是发包时必须是 npm 官方镜像地址:
# 查看当前镜像地址
$ npm config get registry
# 修改 npm 源地址为官方源
$ npm config set registry https://registry.npmjs.org/ 弃用
$ npm config set registry https://registry.npmjs.com/ org可能连不上
# 将 npm 源地址修改为淘宝源(用于安装 npm 速度慢的时候使用)
$ npm config set registry https://registry.npm.taobao.org/
See 参考文档.