diff --git a/pages/index/index.vue b/pages/index/index.vue index 4c5909d..9f8c8bd 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -6,6 +6,9 @@ + @@ -60,6 +63,28 @@ value1: '', value2: '', ltemList: [1, 1, 1, 1, 2, 1, 1, 1, 1], + inputValue_json: '', + candidates_json: [{ + id: '1', + name: '选项一' + }, { + id: '2', + name: '选项二', + disabled: true // 单独设置disabled后即可禁用该选项 + }, { + id: '3', + name: '选项三' + }, { + id: '4', + name: '选项四' + }, { + id: '5', + name: '选项五', + disabled: true // 单独设置disabled后即可禁用该选项 + }, { + id: '6', + name: '...' + }] } }, onLoad() { @@ -74,6 +99,12 @@ uni.navigateTo({ url: '/pages/index/instruct' }) + }, + input_json(e) { + console.log(e) // 选项一 + }, + select_json(e) { + console.log(e) // {id: '1',name: '选项一'} } } }; @@ -158,4 +189,4 @@ } } } - + \ No newline at end of file diff --git a/uni_modules/superwei-combox/changelog.md b/uni_modules/superwei-combox/changelog.md new file mode 100644 index 0000000..592e298 --- /dev/null +++ b/uni_modules/superwei-combox/changelog.md @@ -0,0 +1,22 @@ +## 1.0.10(2022-10-19) +- 修改文档,更改为不兼容小程序(存在下拉框滑动会自动关闭的问题,后期改进后再兼容,若各位有好的解决方法的话欢迎评论) +## 1.0.9(2022-07-28) +- 完善是否创建新条目功能,并将默认值改为允许 +## 1.0.8(2022-07-26) +- 新增禁用选项和是否创建新条目功能,新增disabledColor和isAllowCreate属性 +## 1.0.7(2022-05-05) +- 解决传入JSON数组后,在模糊匹配项中进行选择,@select事件返回值为undefined且报错的问题 +## 1.0.6(2022-03-24) +- 新增@select事件 +## 1.0.5(2022-03-22) +- 修改文档 +## 1.0.4(2022-03-18) +- 新增isJSON和keyName属性,candidates支持JSON数组格式 +## 1.0.3(2022-03-01) +- 调整为uni_modules目录规范 +## 1.0.2(2022-03-01) +- 基于官方uni-combox组件,解决选择后再次选择不展示全部选项的问题,同时新增选中项默认的文字和背景颜色,也可自定义进行样式覆盖 +## 1.0.1(2022-03-01) +- 无 +## 1.0.0(2022-03-01) +- 无 \ No newline at end of file diff --git a/uni_modules/superwei-combox/components/superwei-combox/superwei-combox.vue b/uni_modules/superwei-combox/components/superwei-combox/superwei-combox.vue new file mode 100644 index 0000000..2dc5b0b --- /dev/null +++ b/uni_modules/superwei-combox/components/superwei-combox/superwei-combox.vue @@ -0,0 +1,379 @@ + + + + + diff --git a/uni_modules/superwei-combox/package.json b/uni_modules/superwei-combox/package.json new file mode 100644 index 0000000..443091a --- /dev/null +++ b/uni_modules/superwei-combox/package.json @@ -0,0 +1,89 @@ +{ + "id": "superwei-combox", + "displayName": "superwei-combox 组合框", + "version": "1.0.10", + "description": "下拉搜索选择组合框,基于官方uni-combox组件,解决选择后再次选择不展示全部选项的问题,支持模糊搜索和JSON数组格式,可设置选中项文字和背景颜色(若使用请一定下载uni_modules版本)", + "keywords": [ + "combox", + "组合框", + "select", + "下拉选择", + "搜索选择" +], + "repository": "", +"engines": { + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "u", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "u", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/superwei-combox/readme.md b/uni_modules/superwei-combox/readme.md new file mode 100644 index 0000000..20072f3 --- /dev/null +++ b/uni_modules/superwei-combox/readme.md @@ -0,0 +1,104 @@ +## 基本用法 +在 ``template`` 中使用组件 +```html + + + + + +``` + +## API + +### Combox Props + +|属性名 |类型 |默认值 |说明 | +|:-: |:-: |:-: |:-: | +|label |String |- |标签文字 | +|value |String |- |combox的值 | +|labelWidth |String |auto |标签宽度,有单位字符串,如:'100px' | +|placeholder|String |- |输入框占位符 | +|candidates |Array/String |[] |候选字段 | +|emptyTips |String |无匹配项 |无匹配项时的提示语 | +|selectedBackground |String |#f5f7fa |选中项背景颜色 | +|selectedColor |String |#409eff |选中项文字颜色 | +|isJSON |Boolean |false |候选字段是否是json数组 | +|keyName |String |- |json数组显示的字段值 | +|disabledColor |String |#ababac |禁用项文字颜色 | +|isAllowCreate |Boolean |true |是否允许用户创建新条目 | + +### Combox Events + +|事件称名 |说明 |返回值 | +|:-: |:-: |:-: | +|@input |combox输入事件 |返回combox输入值| +|@select|combox选择事件 |返回combox选项值| diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md new file mode 100644 index 0000000..c7a468a --- /dev/null +++ b/uni_modules/uni-data-checkbox/changelog.md @@ -0,0 +1,45 @@ +## 1.0.3(2022-09-16) +- 可以使用 uni-scss 控制主题色 +## 1.0.2(2022-06-30) +- 优化 在 uni-forms 中的依赖注入方式 +## 1.0.1(2022-02-07) +- 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-checkbox](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox) +## 0.2.5(2021-08-23) +- 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题 +## 0.2.4(2021-08-17) +- 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题 +## 0.2.3(2021-08-11) +- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 +## 0.2.2(2021-07-30) +- 优化 在uni-forms组件,与label不对齐的问题 +## 0.2.1(2021-07-27) +- 修复 单选默认值为0不能选中的Bug +## 0.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 0.1.11(2021-07-06) +- 优化 删除无用日志 +## 0.1.10(2021-07-05) +- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题 +## 0.1.9(2021-07-05) +- 修复 nvue 黑框样式问题 +## 0.1.8(2021-06-28) +- 修复 selectedTextColor 属性不生效的Bug +## 0.1.7(2021-06-02) +- 新增 map 属性,可以方便映射text/value属性 +## 0.1.6(2021-05-26) +- 修复 不关联服务空间的情况下组件报错的Bug +## 0.1.5(2021-05-12) +- 新增 组件示例地址 +## 0.1.4(2021-04-09) +- 修复 nvue 下无法选中的问题 +## 0.1.3(2021-03-22) +- 新增 disabled属性 +## 0.1.2(2021-02-24) +- 优化 默认颜色显示 +## 0.1.1(2021-02-24) +- 新增 支持nvue +## 0.1.0(2021-02-18) +- “暂无数据”显示居中 diff --git a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue new file mode 100644 index 0000000..341a4af --- /dev/null +++ b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue @@ -0,0 +1,821 @@ + + + + + diff --git a/uni_modules/uni-data-checkbox/package.json b/uni_modules/uni-data-checkbox/package.json new file mode 100644 index 0000000..113c350 --- /dev/null +++ b/uni_modules/uni-data-checkbox/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-data-checkbox", + "displayName": "uni-data-checkbox 数据选择器", + "version": "1.0.3", + "description": "通过数据驱动的单选框和复选框", + "keywords": [ + "uni-ui", + "checkbox", + "单选", + "多选", + "单选多选" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "^3.1.1" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-load-more","uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-data-checkbox/readme.md b/uni_modules/uni-data-checkbox/readme.md new file mode 100644 index 0000000..6eb253d --- /dev/null +++ b/uni_modules/uni-data-checkbox/readme.md @@ -0,0 +1,18 @@ + + +## DataCheckbox 数据驱动的单选复选框 +> **组件名:uni-data-checkbox** +> 代码块: `uDataCheckbox` + + +本组件是基于uni-app基础组件checkbox的封装。本组件要解决问题包括: + +1. 数据绑定型组件:给本组件绑定一个data,会自动渲染一组候选内容。再以往,开发者需要编写不少代码实现类似功能 +2. 自动的表单校验:组件绑定了data,且符合[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)组件的表单校验规范,搭配使用会自动实现表单校验 +3. 本组件合并了单选多选 +4. 本组件有若干风格选择,如普通的单选多选框、并列button风格、tag风格。开发者可以快速选择需要的风格。但作为一个封装组件,样式代码虽然不用自己写了,却会牺牲一定的样式自定义性 + +在uniCloud开发中,`DB Schema`中配置了enum枚举等类型后,在web控制台的[自动生成表单](https://uniapp.dcloud.io/uniCloud/schema?id=autocode)功能中,会自动生成``uni-data-checkbox``组件并绑定好data + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file