@hzab/group-user-selector
v0.0.8
Published
组件模板
Readme
@hzab/group-user-selector
组件模板
注意:首次克隆先执行 npm run prepare 命令
组件
示例
import Demo from "@hzab/group-user-selector";
<Demo />;API
InfoPanel Attributes
| 参数 | 类型 | 必填 | 默认值 | 说明 | | ------------------- | ------- | ---- | -------- | ----------------------------------- | | value | Object | 否 | [] | 选中的人员数据 | | model | Object | 否 | - | 列表的请求 model (getListApi) | | modelGetType | string | 否 | getList | 列表的请求类型 | | searchModel | Object | 否 | - | 搜索列表的请求 model (getListApi) | | queryKey | string | 否 | parentId | 列表的请求 model 的入参 key | | searchQueryKey | string | 否 | search | 搜索列表的请求 model 的入参 key | | labelKey | string | 否 | label | labelKey | | valueKey | string | 否 | value | valueKey | | imgKey | string | 否 | img | imgKey 头像 | | isUserKey | string | 否 | isUser | 区分部门和人员 | | hasPagination | boolean | 否 | true | 列表是否分页 | | hasSearch | boolean | 否 | true | 是否有搜索 | | hasSearchPagination | boolean | 否 | true | 搜索列表是否分页 | | searchPlaceholder | string | 否 | "搜索成员"| 搜索框的提示词 |
组件开发流程
- 在 config/webpack.config.js 中按需修改 library 配置的文件名
- 在 config/webpack.config.js 中按需修改 alias 配置的包名,便于本地调试
- 在 tsconfig.json 中按需修改 paths 配置的包名,解决 ts 报错问题
- npm run dev
文件目录
- example 本地开发测试代码
- src 组件源码
命令
Mac 执行该命令,设置 pre-commit 为可执行文件
- npm run mac-chmod
- chmod +x .husky && chmod +x .husky/pre-commit
生成文档:npm run docs
本地运行:npm run dev
打包编译:npm run build
发布
注意:示例代码生效,但发布之后未生效。确认是否执行了编译!!!
编译组件:npm run build
命令:npm publish --access public
发布目录:
- src
配置
配置文件
- 本地配置文件:config/config.js
webpack 配置文件
- config/webpack.config.js
