0.1.12 • Published 11 months ago
raffle-unit v0.1.12
raffle-unit
- 开发的组件放在 packages 文件夹中,命名大驼峰
- npm run start 自动生成组件里面及 package 下的 index.js 文件
- 组件里面必须带有 name 选项
- examples/views 下面文件为组件使用 demo,里面 title 设置为导航名称
- 发布
- npm run start
- npm run build
- 更改版本号
- npm run publish
安装
- 完整引入
npm install raffle-unit -S
// 入口文件 main.js
import RaffleUnit from 'raffle-unit'
import 'raffle-unit/lib/index/style.css'
Vue.use(RaffleUnit)
- 按需引入
npm install raffle-unit -S
npm i babel-plugin-import -D
// 入口文件 main.js
import { Turntable } from 'raffle-unit'
Vue.use(Turntable)
// babel-loader option
{
plugins: [
[
"import",
{
"libraryName": 'raffle-unit',
"style": (name) => {
return `${name}/style.css`;
}
}
]
]
}