yarn install
yarn serve
yarn build
yarn lint
"lib": "vue-cli-service build --target lib --name sigui --dest lib packages/index.js"
- --target: 构建目标,默认为应用模式。这里修改为 lib 启用库模式。
- --dest : 输出目录,默认 dist。这里我们改成 lib
- [entry]: 最后一个参数为入口文件,默认为 src/App.vue。这里我们指定编译 packages/ 组件库目录。
$ npm install -g nrm
$ nrm add sinopia http://npm.sigmob.com
$ nrm use sinopia
$ npm install sigmob-ui -S
$ npm use npm
npm install 其他包……
或者
$ cnpm config set registry http://registry.npm.sigmob.cn
$ cnpm install sigmob-ui -S
$ cnpm config set registry https://registry.npm.taobao.org
$ cnpm install 其他包……
在 main.js
文件中引入插件并注册
# main.js
import sigmobUI from 'sigmob-ui'
Vue.use(sigmobUI)
在项目中使用 sigmob-ui
<template>
<sig-button>按钮</sig-button>
</template>