@crh-fe/ygd-components

0.1.9 • Public • Published

快速上手

注意事项

1、组件名需为[组件库标识]-组件名称
例如你开发了一个login-form表单组件,你的项目组件库标识为cui,那么你的组件名称应该为cui-login-form
2、开发组件的css样式必须创建一个index.less来放置。
3、如果组件内部下props已经有默认值,index.jsonattrs下的 value 可以不设置,否则这个默认值不会生效。

组件:
props: {
    value: {
        type: String,
        default: "默认文案"
    }
}

json配置文件:
attrs: [
    {
        "type": "input",
        "title": "标题",
        "key": "title"
    },
]

4、组件样式的两种写法:
第一种:单独写在index.less文件下。
第二种:写在index.vue内,但是必须加上scoped属性。

如何开发

1. npm 安装 @crh-fe/codease-cli 脚手架

npm install @crh-fe/codease-cli -g

2. 使用 codease init 命令初始化项目,绑定资源库

codease init

2. 安装依赖

<!-- npm方式 -->
npm i
<!-- yarn方式 -->
yarn
<!-- pnpm方式 -->
pnpm i

3. 运行项目

npm run dev

4. 开发项目

5. 使用命令进行打包上传

codease publish

组件库文档站点打包

npm run build-site

Readme

Keywords

none

Package Sidebar

Install

npm i @crh-fe/ygd-components

Weekly Downloads

18

Version

0.1.9

License

MIT

Unpacked Size

12.3 MB

Total Files

1205

Last publish

Collaborators

  • wyx1089
  • lruri
  • xwei111
  • chenchuanxun
  • justli