yjy-ui
v1.0.6
Published
基于 Vue 的内部组件库
Downloads
31
Readme
yjy-ui
安装
npm i yjy-ui -S
使用
引入所有组件
import Vue from 'vue'
import YjyUi from 'yjy-ui'
// 所有样式文件
import 'yjy-ui/packages/theme-chalk/index.css'
Vue.use(YjyUi)
按需引入组件(推荐)
babel-plugin-import 是一款 babel 插件,它会在编译过程中将 import 的写法自动转换为按需引入的方式。
安装插件
npm i babel-plugin-import -D
在babel.config.js 中添加配置
module.exports = {
plugins: [
["import",
{ "libraryName": "yjy-ui",
"libraryDirectory": "packages",
"style": (name, file) => {
// name:yjy-ui/packages/module-click
let tempname = name.split('/')[2]
if (tempname === 'module-click' || tempname === 'module-exposure') {
return false
}
return `yjy-ui/packages/theme-chalk/${tempname}.css`
}
},
"yjy-ui"
]
]
}
在项目中引用
import Vue from 'vue'
import { ColorPicker } from 'yjy-ui'
Vue.use(ColorPicker)
文档本地服务
npm run serve
文档构建
npm run build
sass生成css
npm run gulp
发布npm
npm run lib:publish