0.0.1 • Published 1 year ago

changba-component v0.0.1

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

changba-component

changba-component产生的背景是随着 UI 设计不断的标准化,日常活动较多,而活动的差异性主要体现在玩法部分,因此对一些可重用的组件进行抽离,单独维护。

安装

 npm i changba-component -S

使用

完整引入

import 'changba-component/lib/changba-component.css'
import ChangbaComponent from 'changba-component'
Vue.use(ChangbaComponent)

cdn 没有打包 vue,因此需要独立引入 vue 的 cdn 资源

开发环境启动

npm run dev

创建组件

npm run create <name> <cn-name> <type>
  • name 为组件名称,格式要求如下:
    • 命名统一使用小写单词,多个单词之间以-分隔
    • vue 指令或工具类组件按实际作用命名
  • cn-name 为组件的中文名称
  • type 可选 ui(ui 组件)、directive(vue 指令)、tool(工具)

自动生成文档

npm run docs

代码检查

npm run lint

生成库文件

npm run lib

打包后的文件可以在 html 中直接引用

生产环境打包

npm run build

用于部署,如果发布到 npm 仓库则不需要执行

删除组件

npm run remove <name>
  • name:要删除的组件名称

发布到 npm 仓库

npm publish