diff --git a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue index 80913275347ebb2a99536dd5cec3fc2fa9af9b99..2a5ae57bf38df0e08c6f555ac2059c5bf9976732 100644 --- a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue +++ b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue @@ -2,7 +2,7 @@ - + {{displayValue}} + class="uni-badge" @click="onClick()">{{displayValue}} @@ -13,26 +12,33 @@ * @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景 * @tutorial https://ext.dcloud.net.cn/plugin?id=21 * @property {String} text 角标内容 - * @property {String} type = [default|primary|success|warning|error] 颜色类型 - * @value default 灰色 + * @property {String} size = [normal|small] 角标内容 + * @property {String} type = [info|primary|success|warning|error] 颜色类型 + * @value info 灰色 * @value primary 蓝色 * @value success 绿色 * @value warning 黄色 * @value error 红色 - * @property {String} size = [normal|small] Badge 大小 - * @value normal 一般尺寸 - * @value small 小尺寸 * @property {String} inverted = [true|false] 是否无需背景颜色 + * @property {Number} maxNum 展示封顶的数字值,超过 99 显示 99+ + * @property {String} absolute = [rightTop|rightBottom|leftBottom|leftTop] 开启绝对定位, 角标将定位到其包裹的标签的四角上 + * @value rightTop 右上 + * @value rightBottom 右下 + * @value leftTop 左上 + * @value leftBottom 左下 + * @property {Array[number]} offset 距定位角中心点的偏移量,只有存在 absolute 属性时有效,例如:[-10, -10] 表示向外偏移 10px,[10, 10] 表示向 absolute 指定的内偏移 10px + * @property {String} isDot = [true|false] 是否显示为一个小点 * @event {Function} click 点击 Badge 触发事件 * @example */ + export default { name: 'UniBadge', - emits:['click'], + emits: ['click'], props: { type: { type: String, - default: 'default' + default: 'error' }, inverted: { type: Boolean, @@ -62,7 +68,7 @@ }, size: { type: String, - default: 'normal' + default: 'small' }, customStyle: { type: Object, @@ -136,10 +142,14 @@ height: '10px', borderRadius: '10px' } - }, - displayValue() { - const { isDot, text, maxNum } = this - return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text) + }, + displayValue() { + const { + isDot, + text, + maxNum + } = this + return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text) } }, methods: { @@ -151,9 +161,15 @@ diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json index 4efafd509b3489e15a5081e838f51456acfbb9a4..52bd1c9393df524ffebc9ad3ddcc31521cb3881c 100644 --- a/uni_modules/uni-badge/package.json +++ b/uni_modules/uni-badge/package.json @@ -1,88 +1,88 @@ -{ - "id": "uni-badge", - "displayName": "uni-badge 数字角标", - "version": "1.1.6", - "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", - "keywords": [ - "", - "badge", - "uni-ui", - "uniui", - "数字角标", - "徽章" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "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" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } +{ + "id": "uni-badge", + "displayName": "uni-badge 数字角标", + "version": "1.2.0", + "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", + "keywords": [ + "", + "badge", + "uni-ui", + "uniui", + "数字角标", + "徽章" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [], + "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" + }, + "快应用": { + "华为": "y", + "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-badge/readme.md b/uni_modules/uni-badge/readme.md index d29680be1c2da3d0e6ad943e41568f7d1161fc84..bdf175da9f759cafe6a4bc910c0e8ac0d20fcff7 100644 --- a/uni_modules/uni-badge/readme.md +++ b/uni_modules/uni-badge/readme.md @@ -1,58 +1,10 @@ - - ## Badge 数字角标 > **组件名:uni-badge** > 代码块: `uBadge` - 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - -``` - - -## API - -### Badge Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |角标内容 | -|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)| -|size |String |normal |Badge 大小,可取值:normal、small | -|is-dot |Boolean|false |不展示数字,只有一个小点 | -|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ | -|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 | -|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 | -|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) | -|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])| - -### Badge Events - -|事件名 |事件说明 |返回参数 | -|:-: |:-: |:-: | -|@click |点击 Badge 触发事件| - | - - - +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -## 组件示例 -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) \ No newline at end of file diff --git a/uni_modules/uni-card/changelog.md b/uni_modules/uni-card/changelog.md index c84f1ace5d86ce7b0105d5ff6228c52d2423ee25..c3cd8c45ace0d5838a3f1c1eff8ea0fc349afb9c 100644 --- a/uni_modules/uni-card/changelog.md +++ b/uni_modules/uni-card/changelog.md @@ -1,12 +1,26 @@ +## 1.3.1(2021-12-20) +- 修复 在vue页面下略缩图显示不正常的bug +## 1.3.0(2021-11-19) +- 重构插槽的用法 ,header 替换为 title +- 新增 actions 插槽 +- 新增 cover 封面图属性和插槽 +- 新增 padding 内容默认内边距离 +- 新增 margin 卡片默认外边距离 +- 新增 spacing 卡片默认内边距 +- 新增 shadow 卡片阴影属性 +- 取消 mode 属性,可使用组合插槽代替 +- 取消 note 属性 ,使用actions插槽代替 +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-card](https://uniapp.dcloud.io/component/uniui/uni-card) ## 1.2.1(2021-07-30) - 优化 vue3下事件警告的问题 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.8(2021-07-01) -- 优化 图文卡片无图片加载时,提供占位图标 -- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) -- 修复 thumbnail 不存在仍然占位的 bug -## 1.1.7(2021-05-12) -- 新增 组件示例地址 -## 1.1.6(2021-02-04) -- 调整为uni_modules目录规范 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.8(2021-07-01) +- 优化 图文卡片无图片加载时,提供占位图标 +- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) +- 修复 thumbnail 不存在仍然占位的 bug +## 1.1.7(2021-05-12) +- 新增 组件示例地址 +## 1.1.6(2021-02-04) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-card/components/uni-card/uni-card.vue b/uni_modules/uni-card/components/uni-card/uni-card.vue index 7458b777f1368d1802b2b3d77103e5a742149639..045c082a7933d7832c1f1694eda421162dac9594 100644 --- a/uni_modules/uni-card/components/uni-card/uni-card.vue +++ b/uni_modules/uni-card/components/uni-card/uni-card.vue @@ -1,58 +1,36 @@ @@ -63,22 +41,22 @@ * @description 卡片视图组件 * @tutorial https://ext.dcloud.net.cn/plugin?id=22 * @property {String} title 标题文字 - * @property {String} subTitle 副标题(仅仅mode=title下生效) + * @property {String} subTitle 副标题 + * @property {Number} padding 内容内边距 + * @property {Number} margin 卡片外边距 + * @property {Number} spacing 卡片内边距 * @property {String} extra 标题额外信息 - * @property {String} note 底部信息 + * @property {String} cover 封面图(本地路径需要引入) * @property {String} thumbnail 标题左侧缩略图 - * @property {String} mode = [basic|style|title] 卡片模式 - * @value basic 基础卡片 - * @value style 图文卡片 - * @value title 标题卡片 - * @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 - * @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影 + * @property {Boolean} is-full = [true | false] 卡片内容是否通栏,为 true 时将去除padding值 + * @property {Boolean} is-shadow = [true | false] 卡片内容是否开启阴影 + * @property {String} shadow 卡片阴影 + * @property {Boolean} border 卡片边框 * @event {Function} click 点击 Card 触发事件 - * @example 内容主体,可自定义内容及样式 */ export default { name: 'UniCard', - emits:['click'], + emits: ['click'], props: { title: { type: String, @@ -88,11 +66,23 @@ type: String, default: '' }, + padding: { + type: String, + default: '10px' + }, + margin: { + type: String, + default: '15px' + }, + spacing: { + type: String, + default: '0 10px' + }, extra: { type: String, default: '' }, - note: { + cover: { type: String, default: '' }, @@ -100,10 +90,6 @@ type: String, default: '' }, - mode: { - type: String, - default: 'basic' - }, isFull: { // 内容区域是否通栏 type: Boolean, @@ -111,300 +97,157 @@ }, isShadow: { // 是否开启阴影 - type: [Boolean, String], - default: false + type: Boolean, + default: true + }, + shadow: { + type: String, + default: '0px 0px 3px 1px rgba(0, 0, 0, 0.08)' + }, + border: { + type: Boolean, + default: true } }, methods: { - onClick() { - this.$emit('click') + onClick(type) { + this.$emit('click', type) } } } - diff --git a/uni_modules/uni-card/package.json b/uni_modules/uni-card/package.json index 79533648372c7bd339e04d86911da660ce844ea0..f16224de2b73a95a4f4708243b9b5818ba53ff3d 100644 --- a/uni_modules/uni-card/package.json +++ b/uni_modules/uni-card/package.json @@ -1,85 +1,90 @@ -{ - "id": "uni-card", - "displayName": "uni-card 卡片", - "version": "1.2.1", - "description": "Card 组件,提供常见的卡片样式。", - "keywords": [ - "uni-ui", - "uniui", - "card", - "", - "卡片" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "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" - } - } - } - } -} +{ + "id": "uni-card", + "displayName": "uni-card 卡片", + "version": "1.3.1", + "description": "Card 组件,提供常见的卡片样式。", + "keywords": [ + "uni-ui", + "uniui", + "card", + "", + "卡片" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-icons", + "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-card/readme.md b/uni_modules/uni-card/readme.md index 6f72c837d0df7a5022e84c11257a47e79992f12a..7434e71d2897720b157a92ee90c6f51a7d2bbf98 100644 --- a/uni_modules/uni-card/readme.md +++ b/uni_modules/uni-card/readme.md @@ -4,101 +4,9 @@ > **组件名:uni-card** > 代码块: `uCard` - 卡片视图组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 因为平台兼容问题 , 目前 APP-NVUE 安卓平台下不支持阴影 - - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - 内容主体,可自定义内容及样式 - - - - - - - - - - uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。 - - - - - uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可编译到iOS、Android、H5、以及各种小程序等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。 - - - - - 默认内容 - - -``` - -## API - -### Card Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|title |String |- |标题文字 | -|extra |String |- |标题额外信息 | -|note |String |- |底部信息 | -|thumbnail |String |- |标题左侧缩略图,支持网络图片,本地图片,本图片需要传入一个绝对路径,如:`/static/xxx.png` | -|mode |String |basic |卡片模式 ,可选值, basic:基础卡片 ;style :图文卡片 ; title :标题卡片 | -|isFull |Boolean|false |卡片内容是否通栏,为true时将去除padding值 | -|isShadow |Boolean|false |卡片内容是否开启阴影 | - - -### Card Events - -|事件称名 |事件说明 |返回参数 | -|:-: |:-: |:-: | -|@click |点击 Card 触发事件 |- | - - -### Card Slots - -|插槽称名 |说明 | -|:-: |:-: | -|header |卡片头部插槽( 图文卡片 mode="style" 时,不支持)| -|footer |卡片底部插槽 | +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-card) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -## 组件示例 -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/card/card](https://hellouniapp.dcloud.net.cn/pages/extUI/card/card) \ No newline at end of file diff --git a/uni_modules/uni-collapse/changelog.md b/uni_modules/uni-collapse/changelog.md index c0dba72e0ede34c4b8922c78684c63281578b02a..292e4c79f34d8291119fc98bedf97c40b12dd015 100644 --- a/uni_modules/uni-collapse/changelog.md +++ b/uni_modules/uni-collapse/changelog.md @@ -1,27 +1,36 @@ +## 1.4.3(2022-01-25) +- 修复 初始化的时候 ,open 属性失效的bug +## 1.4.2(2022-01-21) +- 修复 微信小程序resize后组件收起的bug +## 1.4.1(2021-11-22) +- 修复 vue3中个别scss变量无法找到的问题 +## 1.4.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-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse) ## 1.3.3(2021-08-17) - 优化 show-arrow 属性默认为true -## 1.3.2(2021-08-17) -- 新增 show-arrow 属性,控制是否显示右侧箭头 -## 1.3.1(2021-07-30) -- 优化 vue3下小程序事件警告的问题 -## 1.3.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.2.2(2021-07-21) -- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug -## 1.2.1(2021-07-21) -- 优化 组件示例 -## 1.2.0(2021-07-21) -- 新增 组件折叠动画 -- 新增 value\v-model 属性 ,动态修改面板折叠状态 -- 新增 title 插槽 ,可定义面板标题 -- 新增 border 属性 ,显示隐藏面板内容分隔线 -- 新增 title-border 属性 ,显示隐藏面板标题分隔线 -- 修复 resize 方法失效的Bug -- 修复 change 事件返回参数不正确的Bug -- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法 -## 1.1.7(2021-05-12) -- 新增 组件示例地址 -## 1.1.6(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.1.5(2021-02-05) +## 1.3.2(2021-08-17) +- 新增 show-arrow 属性,控制是否显示右侧箭头 +## 1.3.1(2021-07-30) +- 优化 vue3下小程序事件警告的问题 +## 1.3.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.2(2021-07-21) +- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug +## 1.2.1(2021-07-21) +- 优化 组件示例 +## 1.2.0(2021-07-21) +- 新增 组件折叠动画 +- 新增 value\v-model 属性 ,动态修改面板折叠状态 +- 新增 title 插槽 ,可定义面板标题 +- 新增 border 属性 ,显示隐藏面板内容分隔线 +- 新增 title-border 属性 ,显示隐藏面板标题分隔线 +- 修复 resize 方法失效的Bug +- 修复 change 事件返回参数不正确的Bug +- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法 +## 1.1.7(2021-05-12) +- 新增 组件示例地址 +## 1.1.6(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.1.5(2021-02-05) - 调整为uni_modules目录规范 \ No newline at end of file diff --git a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue index 32d63739cc75aaad1d35b30c869434441e7e5049..b2aad1fd0bbe4190e674506216f35613b54c9e74 100644 --- a/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue +++ b/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue @@ -11,11 +11,10 @@ - - + { + this.$nextTick(() => { this.init(true) }) }, - created(){ + created() { this.collapse = this.getCollapse() this.oldHeight = 0 - }, - // #ifndef VUE3 - // TODO vue2 - destroyed() { - if (this.__isUnmounted) return - this.uninstall() - }, + this.onClick(this.open, 'init') + }, + // #ifndef VUE3 + // TODO vue2 + destroyed() { + if (this.__isUnmounted) return + this.uninstall() + }, // #endif - // #ifdef VUE3 - // TODO vue3 - unmounted() { - this.__isUnmounted = true - this.uninstall() - }, + // #ifdef VUE3 + // TODO vue3 + unmounted() { + this.__isUnmounted = true + this.uninstall() + }, // #endif mounted() { if (!this.collapse) return @@ -181,14 +181,14 @@ }) } }, - onClick(isOpen,type) { + onClick(isOpen, type) { if (this.disabled) return this.isOpen = isOpen if (this.isOpen && this.collapse) { this.collapse.setAccordion(this) } - if(type !== 'init'){ - this.collapse.onChange(isOpen,this) + if (type !== 'init') { + this.collapse.onChange(isOpen, this) } }, getCollapseHeight(type, index = 0) { @@ -213,7 +213,7 @@ // #endif this.isheight = true if (type) return - this.onClick(this.open,'init') + this.onClick(this.isOpen, 'init') }) .exec() }, @@ -228,7 +228,7 @@ // #endif this.isheight = true if (type) return - this.onClick(this.open,'init') + this.onClick(this.open, 'init') } }) }, @@ -249,7 +249,7 @@ } - + diff --git a/uni_modules/uni-collapse/package.json b/uni_modules/uni-collapse/package.json index 59731d5b9abd39d5058be5eb78ad0562b8a7a7fb..65349cf9f7056e882abba6128c0dfc66fc244a91 100644 --- a/uni_modules/uni-collapse/package.json +++ b/uni_modules/uni-collapse/package.json @@ -1,88 +1,89 @@ -{ - "id": "uni-collapse", - "displayName": "uni-collapse 折叠面板", - "version": "1.3.3", - "description": "Collapse 组件,可以折叠 / 展开的内容区域。", - "keywords": [ - "uni-ui", - "折叠", - "折叠面板", - "手风琴" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "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": "u" - } - } - } - } -} \ No newline at end of file +{ + "id": "uni-collapse", + "displayName": "uni-collapse 折叠面板", + "version": "1.4.3", + "description": "Collapse 组件,可以折叠 / 展开的内容区域。", + "keywords": [ + "uni-ui", + "折叠", + "折叠面板", + "手风琴" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "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-collapse/readme.md b/uni_modules/uni-collapse/readme.md index 12e872fb1d6f51bdb6fb8259043b1fa3c04b47a2..bc758ebc4f3eee187ee494de5745fe33b69bd3e0 100644 --- a/uni_modules/uni-collapse/readme.md +++ b/uni_modules/uni-collapse/readme.md @@ -8,269 +8,5 @@ 折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - `App` 端默认关闭组件动画 ,因为 `height` 动画开销比较大,会导致页面卡顿,请酌情使用动画 -> - 如在使用组件过程从发现卡顿严重,请尝试停用组件动画,问题原因如上 -> - 在小程序端组件内容发生变化,需要手动调用 resize() 方法,手动更新几点信息,避免出现内容错位 -> - 如需自定义组件默认边框颜色等,请使用插槽自定义内容并合理使用 `border ` 和 `title-border` 属性 -> - 折叠面板仅支持嵌套使用,请勿单独使用 -> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - - -### 基本用法 - -使用 `title` 属性指定面板显示内容 - -使用 `open` 属性默认打开当前面板 - -使用 `disabled` 属性禁用面板 - - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 手风琴效果 - -使用 `accordion` 属性,可以仅打开一个面板并关闭其他已经打开的面板,效果类似手风琴 - -设置 `accordion` 属性时,`open` 属性则生效在最后一个组件 - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 动态设置折叠面板打开状态 - -使用 `v-model` 属性,动态设置面板的显示状态 - -使用 `name` 属性设置每个面板的唯一标识,如不设置使用默认索引,从字符串 `"0"` 开始记数 - -**注意** - -- 如果 `accordion` 属性为 `true` 则 `v-model` 类型为 `String` -- 如果 `accordion` 属性为 `false` 则 `v-model` 类型为 `Array` -- 请注意 `v-model` 属性与 `open` 属性请勿一起使用 ,建议只使用 `v-model` - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -```javascript -export default { - data(){ - return { - value:['key1','key2'], - // 如果设置了 accordion 属性,则使用 string 类型 - // value:'key1' - } - } -} -``` - -### 使用动画 - -使用 `show-animation` 属性开启或关闭面板折叠动画,默认动画开启 - -**注意** - -- `App` 端默认关闭组件动画 ,因为 height 动画开销比较大,会导致页面卡顿,请酌情使用动画,如出现明显卡顿,尝试关闭动画 - - -```html - - - 折叠内容 - - - 折叠内容 - - - 折叠内容 - - -``` - -### 配置图片 - -使用 `thumb` 配置图片地址, 可在面板左侧显示一个图片 - -如需显示更多内容,如图标等,请见下方自定义插槽的说明 - -```html - - - - 折叠内容主体,可自定义内容及样式 - - - -``` - -### 自定义插槽 - -如果需要自定义面板显示,可以使用 `title` 插槽达成完全自定义。下面是一个使用 `uni-list` 的列表示例,需要引入 `uni-list` 组件 - -```html - - - - - - 折叠内容主体,可自定义内容及样式 - - - -``` - -**注意** - -- 在折叠面板组件中使用list时,在 App-Nvue 下请勿单独使用 uni-list-item,会导致组件无法正常显示,其他平台不做限制 -- 在默认插槽里使用 uni-list 组件与上方示例一样,直接写在默认插槽里即可 - -## API - -### Collapse Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|value/v-model|String/Array|-|当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)| -|accordion|Boolean|false|是否开启手风琴效果 | - -### Collapse Event - -|事件称名|说明|返回值| -|:-:|:-:|:-:| -|@change|切换面板时触发 |切换面板时触发,如果是手风琴模式,返回类型为string,否则为array| - -### Collapse Methods - -|方法名称|说明| -|:-:|:-:| -|resize |更新当前列表高度| - -> **提示** -> - resize 方法解决动态添加数据,带动画的折叠面板高度不更新的问题 -> - 需要在数据渲染完毕之后使用 `resize` 方法。推荐在 `this.$nextTick()` 中使用 -> - 当前只有小程序端需要调用此方法,H5\App 端已经做了处理,不需要手动更新高度 -> ```html -> -> -> -> -> {{content}} -> -> -> -> -> 折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。 -> -> -> -> -> -> ``` -> ```javascript -> export default { -> data() { -> return { -> value:['0'], -> content: '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。', -> } -> }, -> methods: { -> add() { -> if (this.content.length > 35) { -> this.content = '折叠内容主体,可自定义内容及样式,点击按钮修改内容使高度发生变化。' -> } else { -> this.content = '折叠内容主体,这是一段比较长内容。通过点击按钮修改后内容后,使组件高度发生变化,在次点击按钮恢复之前的内容和高度。' -> } -> // TODO 小程序中不支持自动更新 ,需要手动resize 更新组件高度 -> // #ifdef MP -> this.$nextTick(() => { -> this.$refs.collapse.resize() -> }) -> // #endif -> } -> } -> } -> ``` - - -### CollapseItem Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|title|String|-|标题文字| -|thumb|String|-|标题左侧缩略图| -|disabled|Boolean|false|是否禁用| -|open|Boolean|false|是否展开面板| -|show-animation|Boolean|false|开启动画| -|border|Boolean|true|折叠面板内容分隔线| -|title-border|String|auto|折叠面板标题分隔线可选值见下方 **TitleBorder Params**| -|show-arrow|Boolean|true|是否显示右侧箭头| - -#### TitleBorder Params - -|参数名|说明| -|:-:|:-:| -|auto|分隔线自动显示| -|none|不显示分隔线| -|show|一直显示分隔线| - -### Collapse Slots - -|插槽名|说明| -|:-:| :-:| -|default|默认插槽| -|title|面板标题插槽,如使用此插槽禁用样式效果将失效| - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse](https://hellouniapp.dcloud.net.cn/pages/extUI/collapse/collapse) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-combox/changelog.md b/uni_modules/uni-combox/changelog.md index 77cedbd7cc4b66c4dcb920ca4026f69ca4cc363c..15256a2e79a8bb35f08b25e22338183edd47a09f 100644 --- a/uni_modules/uni-combox/changelog.md +++ b/uni_modules/uni-combox/changelog.md @@ -1,5 +1,10 @@ -## 0.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.1(2021-11-23) +- 优化 label、label-width 属性 +## 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-combox](https://uniapp.dcloud.io/component/uniui/uni-combox) +## 0.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 0.0.6(2021-05-12) - 新增 组件示例地址 ## 0.0.5(2021-04-21) diff --git a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue index 3c201d3a2a178309089ddd3d9530dc6af9b06c02..98bf152e30457eb9c037d82859c69af4bdfb9fec 100644 --- a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue +++ b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue @@ -1,22 +1,26 @@ @@ -35,8 +39,12 @@ */ export default { name: 'uniCombox', - emits:['input','update:modelValue'], + emits: ['input', 'update:modelValue'], props: { + border: { + type: Boolean, + default: true + }, label: { type: String, default: '' @@ -81,11 +89,9 @@ computed: { labelStyle() { if (this.labelWidth === 'auto') { - return {} - } - return { - width: this.labelWidth + return "" } + return `width: ${this.labelWidth}` }, filterCandidates() { return this.candidates.filter((item) => { @@ -144,10 +150,15 @@ diff --git a/uni_modules/uni-combox/package.json b/uni_modules/uni-combox/package.json index 951a901598afdd9aac83954b290f6aca402fcbec..3fed6140a9c50c12004ce4f5f169e0d57d4efe1e 100644 --- a/uni_modules/uni-combox/package.json +++ b/uni_modules/uni-combox/package.json @@ -1,7 +1,7 @@ { "id": "uni-combox", "displayName": "uni-combox 组合框", - "version": "0.1.0", + "version": "1.0.1", "description": "可以选择也可以输入的表单项 ", "keywords": [ "uni-ui", @@ -42,6 +42,7 @@ }, "uni_modules": { "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -78,6 +79,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-combox/readme.md b/uni_modules/uni-combox/readme.md index edab4d409d273103f364792c5b891f9da57644bf..d9f08d57e5e48e7fe55d18f2ec7442a72f5daa3f 100644 --- a/uni_modules/uni-combox/readme.md +++ b/uni_modules/uni-combox/readme.md @@ -1,52 +1,11 @@ - - -## Combox 组合框 -> **组件名:uni-combox** -> 代码块: `uCombox` - - -组合框组件。 - -### 平台兼容性说明 - -**暂不支持nvue** - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 -```html - -``` - -## API - -### Combox Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|label |String |- |标签文字 | -|value |String |- |combox的值 | -|labelWidth |String |auto |标签宽度,有单位字符串,如:'100px' | -|placeholder|String |- |输入框占位符 | -|candidates |Array/String |[] |候选字段 | -|emptyTips |String |无匹配项 |无匹配项时的提示语 | - -### Combox Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@input |combox输入事件 |返回combox值| - - - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox](https://hellouniapp.dcloud.net.cn/pages/extUI/combox/combox) \ No newline at end of file + + +## Combox 组合框 +> **组件名:uni-combox** +> 代码块: `uCombox` + + +组合框组件。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-combox) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-countdown/changelog.md b/uni_modules/uni-countdown/changelog.md index e551725b461a2e2b5e52dec681e5585e6705794a..f25beefca64d4da9c8617324d652dff3b2ab3f36 100644 --- a/uni_modules/uni-countdown/changelog.md +++ b/uni_modules/uni-countdown/changelog.md @@ -1,3 +1,13 @@ +## 1.2.2(2022-01-19) +- 修复 在微信小程序中样式不生效的bug +## 1.2.1(2022-01-18) +- 新增 update 方法 ,在动态更新时间后,刷新组件 +## 1.2.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-countdown](https://uniapp.dcloud.io/component/uniui/uni-countdown) +## 1.1.3(2021-10-18) +- 重构 +- 新增 font-size 支持自定义字体大小 ## 1.1.2(2021-08-24) - 新增 支持国际化 ## 1.1.1(2021-07-30) diff --git a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue index 1f916bd5e8ac788c749b0f8882bd69fc7e31dd86..5f63365e338108d39d1b8b7e4cd98ae70df7faf8 100644 --- a/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue +++ b/uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue @@ -1,25 +1,23 @@ + diff --git a/uni_modules/uni-countdown/package.json b/uni_modules/uni-countdown/package.json index 7960b62e9ff41de8976a2f4e3ba1d2ea00f06668..70e99ee7cf615d5a60a69c3dc9495cdf0d75de7b 100644 --- a/uni_modules/uni-countdown/package.json +++ b/uni_modules/uni-countdown/package.json @@ -1,7 +1,7 @@ { "id": "uni-countdown", "displayName": "uni-countdown 倒计时", - "version": "1.1.2", + "version": "1.2.2", "description": "CountDown 倒计时组件", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-countdown/readme.md b/uni_modules/uni-countdown/readme.md index 25c2a3a2756009668fe23208a4aab6048f088d10..4bcb1aa71694bf71daad7a822897d29485f5b74d 100644 --- a/uni_modules/uni-countdown/readme.md +++ b/uni_modules/uni-countdown/readme.md @@ -4,54 +4,7 @@ > **组件名:uni-countdown** > 代码块: `uCountDown` - 倒计时组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - - -``` - -## API - -### Countdown Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|backgroundColor |String |#FFFFFF|背景色 | -|color |String |#000000|文字颜色 | -|splitorColor |String |#000000|分割符号颜色 | -|day |Number |0 |天数 | -|hour |Number |0 |小时 | -|minute |Number |0 |分钟 | -|second |Number |0 |秒 | -|showDay |Boolean|true |是否显示天数 | -|showColon |Boolean|true |是否以冒号为分隔符 | -|start |Boolean|true |是否初始化组件后就开始倒计时| - -### Countdown Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@timeup|倒计时时间到触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown](https://hellouniapp.dcloud.net.cn/pages/extUI/countdown/countdown) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-countdown) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md index 47e9f4c23dc963643fed6b72abda998b61656360..d8f420b9a6cfec68b7fd755ab516f26f8f2dfd39 100644 --- a/uni_modules/uni-data-checkbox/changelog.md +++ b/uni_modules/uni-data-checkbox/changelog.md @@ -1,36 +1,41 @@ +## 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) -- “暂无数据”显示居中 +## 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 index 7d3d52ece4b778e5521347aeaa737bb16aef5d90..300cb5fe6e7e31a60b2bc2c9a15b48dc15ac4315 100644 --- 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 @@ -65,15 +65,9 @@ * @event {Function} change 选中发生变化触发 */ - // import clientdb from './clientdb.js' export default { name: 'uniDataChecklist', - // mixins: [clientdb], mixins: [uniCloud.mixinDatacom || {}], - // model: { - // prop: 'modelValue', - // event: 'update:modelValue' - // }, emits:['input','update:modelValue','change'], props: { mode: { @@ -185,8 +179,8 @@ }, isLocal:true, styles: { - selectedColor: '#007aff', - selectedTextColor: '#333', + selectedColor: '#2979ff', + selectedTextColor: '#666', }, isTop:0 }; @@ -381,7 +375,7 @@ selectedArr.push(item[this.map.value]) } }) - return this.dataValue.length > 0 ? this.dataValue : selectedArr + return this.dataValue && this.dataValue.length > 0 ? this.dataValue : selectedArr }, /** @@ -389,7 +383,7 @@ */ setStyleBackgroud(item) { let styles = {} - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' if (this.mode !== 'list') { styles['border-color'] = item.selected?selectedColor:'#DCDFE6' } @@ -405,7 +399,7 @@ setStyleIcon(item) { let styles = {} let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' styles['background-color'] = item.selected?selectedColor:'#fff' styles['border-color'] = item.selected?selectedColor:'#DCDFE6' @@ -422,11 +416,11 @@ setStyleIconText(item) { let styles = {} let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#007aff' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' if (this.mode === 'tag') { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#333' + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666' } else { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#333' + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666' } if(!item.selected && item.disabled){ styles.color = '#999' @@ -454,7 +448,7 @@ + + /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ + .uni-popper__arrow, + .uni-popper__arrow::after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 6px; + } + + .uni-popper__arrow { + filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); + top: -6px; + left: 10%; + margin-right: 3px; + border-top-width: 0; + border-bottom-color: #EBEEF5; + } + + .uni-popper__arrow::after { + content: " "; + top: 1px; + margin-left: -6px; + border-top-width: 0; + border-bottom-color: #fff; + } + diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue index 8efd48390ca4792c60746ce822591b964dcafa76..44b72ca3d2cc072a562d12d19fbfc419916ba0e8 100644 --- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue +++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue @@ -58,10 +58,10 @@ managedMode: { type: Boolean, default: false - }, - ellipsis: { - type: Boolean, - default: true + }, + ellipsis: { + type: Boolean, + default: true } }, data() { @@ -288,7 +288,7 @@ .item { padding: 12px 15px; - border-bottom: 1px solid #f0f0f0; + /* border-bottom: 1px solid #f0f0f0; */ /* #ifndef APP-NVUE */ display: flex; /* #endif */ @@ -330,4 +330,4 @@ /* #endif */ transform: rotate(45deg); } - + diff --git a/uni_modules/uni-data-picker/package.json b/uni_modules/uni-data-picker/package.json index 0647354f763695637a2be5949772fdb225ade9c0..04953b6a04fe875d7012c8e85ac4a05852f14087 100644 --- a/uni_modules/uni-data-picker/package.json +++ b/uni_modules/uni-data-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-data-picker", "displayName": "uni-data-picker 数据驱动的picker选择器", - "version": "0.4.9", + "version": "1.0.1", "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", "keywords": [ "uni-ui", @@ -43,8 +43,9 @@ }, "uni_modules": { "dependencies": [ - "uni-load-more", - "uni-icons" + "uni-load-more", + "uni-icons", + "uni-scss" ], "encrypt": [], "platforms": { diff --git a/uni_modules/uni-data-picker/readme.md b/uni_modules/uni-data-picker/readme.md index d466274845937e7252a71fbba177b8aff548e736..a6bf10f3776feddac1fe6f4e10a54370052345ce 100644 --- a/uni_modules/uni-data-picker/readme.md +++ b/uni_modules/uni-data-picker/readme.md @@ -1,286 +1,22 @@ -## DataPicker 级联选择 -> **组件名:uni-data-picker** -> 代码块: `uDataPicker` -> 关联组件:`uni-data-pickerview`、`uni-load-more`。 - - -`` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。 - -支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。 - -候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。 - -`` 组件尤其适用于地址选择、分类选择等选择类。 - -`` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。 - -`` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。 - -在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。 - - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -> - `` 内部包含了弹出层组件 `` 外层的布局可能会影响弹出层,[详情](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Common_CSS_Questions) - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`componets`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -## API - -### DataPicker Props - -|属性名 | 类型 | 可选值 | 默认值 | 说明| -|:-: | :-: |:-: | :-: | :-: | -|v-model |String/ Number | - | - |绑定数据| -|spaceInfo |Object | | |服务空间配置,[详情](https://uniapp.dcloud.net.cn/uniCloud/init)| -|localdata |Array | | |数据,[详情](https://gitee.com/dcloud/datacom)| -|preload |Boolean | true/false | false |预加载数据| -|readonly |Boolean | true/false | false |是否禁用| -|clear-icon |Boolean | true/false | true |是否显示清除按钮| -|ellipsis |Boolean | true/false | true |是否隐藏 tab 标签过长的文本| -|step-searh |Boolean | true/false | true |分步查询时,点击节点请求数据| -|step-search-url |String | | |分步查询时,动态加载云端数据url格式,`https://xxx.com/{parentValue}`(当前版本暂不支持,下版支持)| -|self-field |String | | |分步查询时当前字段名称| -|parent-field |String | | |分步查询时父字段名称| -|collection |String | | |表名。支持输入多个表名,用 `,` 分割| -|field |String | | |查询字段,多个字段用 `,` 分割| -|where |String | | |查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=jsquery)| -|orderby |String | | |排序字段及正序倒叙设置| -|popup-title |String | | |弹出层标题| -|map |Object | |{text:'text',value:'value'}|字段映射,将text/value映射到数据中的其他字段| - -> **** -> `collection/where/orderby` 和 `` 的用法一致,[详情](https://uniapp.dcloud.net.cn/uniCloud/unicloud-db) - - - -### DataPicker Events - -|事件称名 | 类型 | 说明 | -|:-: | :-: | :-: | -|@change |EventHandle | 选择完成时触发 {detail: {value}} | -|@nodeclick |EventHandle | 节点被点击时触发 | -|@stepsearch |EventHandle | 动态加载节点数据前触发(当前版本暂不支持,下版支持) | -|@popupopened |EventHandle | 弹出层弹出时触发 | -|@popupclosed |EventHandle | 弹出层关闭时触发 | - -### DataPicker Methods - -|方法称名 |说明|参数| -|:-:|:-:|:-:| -|show|打开弹出层|-| -|hide|关闭弹出层|-| -|clear|清除已选项|-| - -**使用方法:** -```js -this.$refs.picker.show() // `picker` 为组件的 ref 名称 -``` - -### DataPicker Slots - -|名称|说明| -|:-:|:-:| -|default|覆盖显示框内容| - - -### 基本用法 - -#### 云端数据 - -> **注意事项** -> - 云端数据需要关联服务空间 -> - 下面示例中使用的表 `opendb-city-china`(中国城市省市区数据,含港澳台), 在[uniCloud控制台](https://unicloud.dcloud.net.cn/)使用opendb创建,[详情](https://gitee.com/dcloud/opendb) - - -```html - -``` - -```js - - -``` - - - - - -#### 本地数据 - -```html - -``` - -```js - - -``` - - -#### 自定义solt - -```html - - - {{error}} - - - - {{item.text}} - - - - 请选择 - - -``` - - -> **注意事项** -> `localdata` 和 `collection` 同时配置时,`localdata` 优先 - - - -#### 完整示例 - -```html - -``` - -```js - - -``` - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/data-picker/data-picker) \ No newline at end of file +## DataPicker 级联选择 +> **组件名:uni-data-picker** +> 代码块: `uDataPicker` +> 关联组件:`uni-data-pickerview`、`uni-load-more`。 + + +`` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。 + +支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。 + +候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。 + +`` 组件尤其适用于地址选择、分类选择等选择类。 + +`` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。 + +`` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。 + +在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-dateformat/changelog.md b/uni_modules/uni-dateformat/changelog.md index 7006d13a0854c4f636bef64670a4de41526789db..09aacd8d10fb2d32c5841a551cc766f04d5a3b93 100644 --- a/uni_modules/uni-dateformat/changelog.md +++ b/uni_modules/uni-dateformat/changelog.md @@ -1,7 +1,10 @@ -## 0.0.5(2021-07-08) -- 调整 默认时间不再是当前时间,而是显示'-'字符 -## 0.0.4(2021-05-12) -- 新增 组件示例地址 -## 0.0.3(2021-02-04) -- 调整为uni_modules目录规范 -- 修复 iOS 平台日期格式化出错的问题 +## 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-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat) +## 0.0.5(2021-07-08) +- 调整 默认时间不再是当前时间,而是显示'-'字符 +## 0.0.4(2021-05-12) +- 新增 组件示例地址 +## 0.0.3(2021-02-04) +- 调整为uni_modules目录规范 +- 修复 iOS 平台日期格式化出错的问题 diff --git a/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue b/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue index c5ed03078b25ab149f531e86385dfef4c9d7f4cc..83303ed7d46d6ad853f97b470eb4a7c0d369ba79 100644 --- a/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue +++ b/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue @@ -1,88 +1,88 @@ - - - - - + + + + + diff --git a/uni_modules/uni-dateformat/package.json b/uni_modules/uni-dateformat/package.json index 93023ad9aa63054e368339ae0407d1f97abf584d..99b9df35ac51f1426cd90d96cd764b9d7a3d3dfa 100644 --- a/uni_modules/uni-dateformat/package.json +++ b/uni_modules/uni-dateformat/package.json @@ -1,7 +1,7 @@ { "id": "uni-dateformat", "displayName": "uni-dateformat 日期格式化", - "version": "0.0.5", + "version": "1.0.0", "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式", "keywords": [ "uni-ui", @@ -42,7 +42,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -77,6 +77,10 @@ "快应用": { "华为": "y", "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-dateformat/readme.md b/uni_modules/uni-dateformat/readme.md index 7d2da4aa033e718269d8d3d662ce98b4e788c234..fef45fbc654717d209552d9e56da89c6d0ae6de4 100644 --- a/uni_modules/uni-dateformat/readme.md +++ b/uni_modules/uni-dateformat/readme.md @@ -1,77 +1,11 @@ - - -### DateFormat 日期格式化 -> **组件名:uni-dateformat** -> 代码块: `uDateformat` - - -日期格式化组件。 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - -``` - -## API - -### Dateformat Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|date |Object|String|Number |Date.now() |要格式化的日期对象/日期字符串/时间戳 | -|threshold |Array |[0, 0] |转化类型阈值 | -|format |String |'yyyy/MM/dd hh:mm:ss' |格式字符串 | -|locale |String |zh |格式化使用的语言,目前支持zh(中文)、en(英文) | - - -#### Threshold Options - -格式化组件会对时间进行用户友好转化,threshold就是用来控制转化的时间阈值的。 - -以`[60000, 3600000]`为例,将传入时间与当前时间差的绝对值记为delta(单位毫秒) - -- `delta < 60000`时,时间会被转化为“刚刚|马上” -- `delta >= 60000 && delta < 3600000`时,时间会被转化为“xx分钟前|xx分钟后”,如果超过1小时会显示成“xx小时前|xx小时后”,以此类推 -- `delta >= 3600000`时,会按照format参数传入的格式进行格式化 - -如果不想转化为“马上|刚刚”可以传入`:threshold = "[0,3600000]"`。默认值`[0,0]`既不会转换为“马上|刚刚”也不会转化为“xx分钟前|xx分钟后” - -#### Format Options - -format接收字符以及含义如下: - -|字符 |说明 | -|:-: |:-: | -|yyyy |四位年份 | -|yy |两位年份 | -|MM |两位月份(不足两位在前面补0) | -|M |月份,不自动补0 | -|dd |两位天(不足两位在前面补0) | -|d |天,不自动补0 | -|hh |两位小时(不足两位在前面补0) | -|h |小时,不自动补0 | -|mm |两位分钟(不足两位在前面补0) | -|m |分钟,不自动补0 | -|ss |两位秒(不足两位在前面补0) | -|s |秒,不自动补0 | -|SSS |三位毫秒(不足三位在前面补0) | -|S |毫秒,不自动补0 | - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat](https://hellouniapp.dcloud.net.cn/pages/extUI/dateformat/dateformat) \ No newline at end of file + + +### DateFormat 日期格式化 +> **组件名:uni-dateformat** +> 代码块: `uDateformat` + + +日期格式化组件。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md index 4182e0c2148f2f6a623c69fddb1d06a778170689..381c9a887a8f11aed435f4d21c8513c4bef71428 100644 --- a/uni_modules/uni-datetime-picker/changelog.md +++ b/uni_modules/uni-datetime-picker/changelog.md @@ -1,3 +1,12 @@ +## 2.2.2(2021-12-10) +- 修复 clear-icon 属性在小程序平台不生效的 bug +## 2.2.1(2021-12-10) +- 修复 日期范围选在小程序平台,必须多点击一次才能取消选中状态的 bug +## 2.2.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-datetime-picker](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) +## 2.1.5(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 ## 2.1.4(2021-09-10) - 修复 hide-second 在移动端的 bug - 修复 单选赋默认值时,赋值日期未高亮的 bug diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue index 7c9a093c898e3b039f65c3f67e1449d529b80685..8d68d0f8e22b3e7de0de6e56eb8ffb9973c4e8fa 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue @@ -6,17 +6,17 @@ 'uni-calendar-item--after-checked-x':weeks.afterMultiple, }" @click="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)"> + }"> - {{weeks.date}} - + {{weeks.date}} + + @@ -70,18 +70,20 @@ flex-direction: column; justify-content: center; align-items: center; - margin: 3px 0; + margin: 1px 0; + position: relative; } .uni-calendar-item__weeks-box-text { - font-size: 12px; - // font-size: $uni-font-size-base; - // color: $uni-text-color; + font-size: 14px; + // font-family: Lato-Bold, Lato; + font-weight: bold; + color: #455997; } .uni-calendar-item__weeks-lunar-text { - font-size: $uni-font-size-sm; - color: $uni-text-color; + font-size: 12px; + color: #333; } .uni-calendar-item__weeks-box-item { @@ -107,38 +109,43 @@ width: 8px; height: 8px; border-radius: 8px; - background-color: $uni-color-error; + background-color: #dd524d; } .uni-calendar-item__weeks-box .uni-calendar-item--disable { // background-color: rgba(249, 249, 249, $uni-opacity-disabled); - color: $uni-text-color-disable; cursor: default; + } + + .uni-calendar-item--disable .uni-calendar-item__weeks-box-text-disable { + color: #D1D1D1; } - .uni-calendar-item__weeks-box .uni-calendar-item--isDay-text { - color: $uni-color-primary; - } - - .uni-calendar-item--isDay { - background-color: $uni-color-primary; - opacity: 0.8; - color: #fff; + .uni-calendar-item--isDay { + position: absolute; + top: 10px; + right: 17%; + background-color: #dd524d; + width:6px; + height: 6px; + border-radius: 50%; } .uni-calendar-item--extra { - color: $uni-color-error; + color: #dd524d; opacity: 0.8; } .uni-calendar-item__weeks-box .uni-calendar-item--checked { - background-color: $uni-color-primary; - // border-radius: 50%; + background-color: #007aff; + border-radius: 50%; box-sizing: border-box; - border: 6px solid #f2f6fc; - color: #fff; - opacity: 0.8; + border: 3px solid #fff; + } + + .uni-calendar-item--checked .uni-calendar-item--checked-text { + color: #fff; } .uni-calendar-item--multiple .uni-calendar-item--checked-range-text { @@ -146,36 +153,33 @@ } .uni-calendar-item--multiple { - background-color: #f2f6fc; + background-color: #F6F7FC; // color: #fff; - opacity: 0.8; - } - - .uni-calendar-item--multiple .uni-calendar-item--before-checked { - background-color: #409eff; - color: #fff !important; - // border-radius: 50%; - box-sizing: border-box; - border: 6px solid #f2f6fc; } + .uni-calendar-item--multiple .uni-calendar-item--before-checked, .uni-calendar-item--multiple .uni-calendar-item--after-checked { - background-color: #409eff;; - color: #fff !important; - // border-radius: 50%; + background-color: #409eff; + border-radius: 50%; box-sizing: border-box; - border: 6px solid #f2f6fc; + border: 3px solid #F6F7FC; + } + + .uni-calendar-item--before-checked .uni-calendar-item--checked-text, + .uni-calendar-item--after-checked .uni-calendar-item--checked-text { + color: #fff; } .uni-calendar-item--before-checked-x { - // border-top-left-radius: 25px; - // border-bottom-left-radius: 25px; - background-color: #f2f6fc; + border-top-left-radius: 50px; + border-bottom-left-radius: 50px; + box-sizing: border-box; + background-color: #F6F7FC; } .uni-calendar-item--after-checked-x { - // border-top-right-radius: 25px; - // border-bottom-right-radius: 25px; - background-color: #f2f6fc; + border-top-right-radius: 50px; + border-bottom-right-radius: 50px; + background-color: #F6F7FC; } diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue index d04b9cf23ba1d2aec7082721506bdd3ac6d4f835..fc16928b1f15a1ce5dc4bcb5b60e185b5dbea72b 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue @@ -3,26 +3,30 @@ - - + :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}"> + - {{ (nowDate.year||'') +' / '+( nowDate.month||'')}} + {{ (nowDate.year||'') + ' 年 ' + ( nowDate.month||'') +' 月'}} - + + + + + {{nowDate.month}} - + {{SUNText}} @@ -66,22 +70,23 @@ {{tempRange.before ? tempRange.before : startDateText}} - + {{tempRange.after ? tempRange.after : endDateText}} - + - - + + + 确认 @@ -187,10 +192,10 @@ checkHover: { type: Boolean, default: true - }, - hideSecond: { - type: [Boolean], - default: false + }, + hideSecond: { + type: [Boolean], + default: false }, pleStatus: { type: Object, @@ -228,25 +233,25 @@ date: { immediate: true, handler(newVal, oldVal) { - if (!this.range) { + if (!this.range) { this.tempSingleDate = newVal setTimeout(() => { this.init(newVal) }, 100) } } - }, - defTime: { - immediate: true, - handler(newVal, oldVal) { - if (!this.range) { - this.time = newVal - } else { - // console.log('-----', newVal); - this.timeRange.startTime = newVal.start - this.timeRange.endTime = newVal.end - } - } + }, + defTime: { + immediate: true, + handler(newVal, oldVal) { + if (!this.range) { + this.time = newVal + } else { + // console.log('-----', newVal); + this.timeRange.startTime = newVal.start + this.timeRange.endTime = newVal.end + } + } }, startDate(val) { this.cale.resetSatrtDate(val) @@ -361,7 +366,6 @@ }) // 选中某一天 // this.cale.setDate(this.date) - this.init(this.date) // this.setDay }, @@ -411,8 +415,8 @@ } else { this.time = '' this.tempSingleDate = '' - } - this.calendar.fullDate = '' + } + this.calendar.fullDate = '' this.setDate() }, @@ -425,7 +429,6 @@ * @param {Object} date */ init(date) { - this.cale.setDate(date) this.weeks = this.cale.weeks this.nowDate = this.calendar = this.cale.getInfo(date) @@ -605,7 +608,7 @@ top: 0; left: 0; right: 0; - background-color: $uni-bg-color-mask; + background-color: rgba(0, 0, 0, 0.4); transition-property: opacity; transition-duration: 0.3s; opacity: 0; @@ -639,6 +642,12 @@ background-color: #fff; } + .uni-calendar__content-mobile { + border-top-left-radius: 10px; + border-top-right-radius: 10px; + box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1); + } + .uni-calendar__header { position: relative; /* #ifndef APP-NVUE */ @@ -648,9 +657,11 @@ justify-content: center; align-items: center; height: 50px; - // border-bottom-color: $uni-border-color; - // border-bottom-style: solid; - // border-bottom-width: 1px; + } + + .uni-calendar__header-mobile { + padding: 10px; + padding-bottom: 0; } .uni-calendar--fixed-top { @@ -659,14 +670,13 @@ /* #endif */ flex-direction: row; justify-content: space-between; - border-top-color: $uni-border-color; + border-top-color: rgba(0, 0, 0, 0.4); border-top-style: solid; border-top-width: 1px; } .uni-calendar--fixed-width { width: 50px; - // padding: 0 15px; } .uni-calendar__backtoday { @@ -680,21 +690,21 @@ font-size: 12px; border-top-left-radius: 25px; border-bottom-left-radius: 25px; - color: $uni-text-color; - background-color: $uni-bg-color-hover; + color: #fff; + background-color: #f1f1f1; } .uni-calendar__header-text { text-align: center; width: 100px; - font-size: $uni-font-size-base; - color: $uni-text-color; + font-size: 15px; + color: #666; } .uni-calendar__button-text { text-align: center; width: 100px; - font-size: $uni-font-size-base; + font-size: 14px; color: #007aff; /* #ifndef APP-NVUE */ letter-spacing: 3px; @@ -713,12 +723,12 @@ } .uni-calendar__header-btn { - width: 8px; - height: 8px; - border-left-color: $uni-text-color-placeholder; + width: 9px; + height: 9px; + border-left-color: #808080; border-left-style: solid; border-left-width: 1px; - border-top-color: $uni-color-subtitle; + border-top-color: #555555; border-top-style: solid; border-top-width: 1px; } @@ -760,10 +770,13 @@ .uni-calendar__weeks-day-text { font-size: 12px; + color: #B2B2B2; } .uni-calendar__box { position: relative; + // padding: 0 10px; + padding-bottom: 7px; } .uni-calendar__box-bg { @@ -782,7 +795,7 @@ .uni-calendar__box-bg-text { font-size: 200px; font-weight: bold; - color: $uni-text-color-grey; + color: #999; opacity: 0.1; text-align: center; /* #ifndef APP-NVUE */ @@ -795,12 +808,17 @@ // line-height: 50px; text-align: center; color: #333; - border-top-color: $uni-border-color; + border-top-color: #DCDCDC; + ; border-top-style: solid; border-top-width: 1px; flex: 1; } + .uni-date-btn--ok { + padding: 20px 15px; + } + .uni-date-changed--time-start { /* #ifndef APP-NVUE */ display: flex; @@ -834,4 +852,47 @@ .mr-10 { margin-right: 10px; } + + .dialog-close { + position: absolute; + top: 0; + right: 0; + bottom: 0; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: row; + align-items: center; + padding: 0 25px; + margin-top: 10px; + } + + .dialog-close-plus { + width: 16px; + height: 2px; + background-color: #737987; + border-radius: 2px; + transform: rotate(45deg); + } + + .dialog-close-rotate { + position: absolute; + transform: rotate(-45deg); + } + + .uni-datetime-picker--btn { + border-radius: 100px; + height: 40px; + line-height: 40px; + background-color: #007aff; + color: #fff; + font-size: 16px; + letter-spacing: 5px; + } + + /* #ifndef APP-NVUE */ + .uni-datetime-picker--btn:active { + opacity: 0.7; + } + /* #endif */ diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue index 362b4f8fec775694bbea28c913f763400f15623f..912bd6870668e863f6f213ce109c6939d753b555 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue @@ -5,16 +5,12 @@ - + - + @@ -23,9 +19,8 @@ - - + + @@ -34,7 +29,8 @@ - + + - + @change="singleChange" style="padding: 0 8px;" /> {{okText}} @@ -54,7 +50,8 @@ - + + @@ -77,14 +74,14 @@ - - + + @monthSwitch="rightMonthSwitch" style="padding: 0 8px;border-left: 1px solid #F1F1F1;" /> {{clearText}} @@ -92,7 +89,7 @@ - @@ -104,10 +101,10 @@ * @description 同时支持 PC 和移动端使用日历选择日期和日期范围 * @tutorial https://ext.dcloud.net.cn/plugin?id=3962 * @property {String} type 选择器类型 - * @property {String|Array} value 绑定值 + * @property {String|Number|Array|Date} value 绑定值 * @property {String} placeholder 单选择时的占位内容 * @property {String} start 起始时间 - * @property {String} start 终止时间 + * @property {String} end 终止时间 * @property {String} start-placeholder 范围选择时开始日期的占位内容 * @property {String} end-placeholder 范围选择时结束日期的占位内容 * @property {String} range-separator 选择范围时的分隔符 @@ -115,6 +112,9 @@ * @property {Boolean} disabled = [true|false] 是否禁用 * @property {Boolean} clearIcon = [true|false] 是否显示清除按钮(仅PC端适用) * @event {Function} change 确定日期时触发的事件 + * @event {Function} show 打开弹出层 + * @event {Function} close 关闭弹出层 + * @event {Function} clear 清除上次选中的状态和值 **/ import calendar from './calendar.vue' import timePicker from './time-picker.vue' @@ -180,7 +180,6 @@ isEmitValue: false, isPhone: false, isFirstShow: true, - iconBase64: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAACVklEQVRoge2Zv2vTQRTAP4oWJQQskmolBAnSQVMcSxbp4ubmIEWETu0oIjg5iIOgpLNunfQfMHToUgpOVgfRqRAL4q8WRLQVq4sOdyHPL9/7evfNJReS+8DB433v7r37fl/eu9xBJBKUB0BLt+uDaOOQZb8SUNXyuKuRftg46NeXcBww6M8AC0ANOAycAyb1s7e6+SbNxi/gBfAQ2HadcA7YB/4MUPsKzLos4jzwewAcNy3mhMnx5I/9BiqUAD4DDWAXmAfqWt8Enlq+GBfSbEwAt4AicAxYBO7aTPaGzhu4KvTLQn/Hh9cpmGzcFvqmaXAyaxWE/MGTg93yXsgFUyfbOrJCJ2s8y+tRP21s0fmMTlmih8zT8WnN1GloCmJWaF0CpvrlSAb1/3fJXshNT470hZEIrZeoahqaU8BZ10Exa4XGtiCaKKL+EIHaMX8U81ZEP7ntrwi7n4CfWi7p+UCFdFdh7Rpaps9+mn93rjY2THut0QqtoVlIkpi1QjNyCzEdnl0W+idCXxb6VmKudaGfsbBhRbcHdEWhf5eYt0o6FVR6BjhqYcOKoQkt2y/SAB5rWVbpVeCilmUl3hb6JNeAI1p+ZWEjFzH9hsY2tEwHdHX9DGATWNLyceCeGL/YhY+58LWhy9o0uhJDKw3T4dlr4L6WZab5JvRBGJqs9UPI5R44lQfpx56pUzK0NlA3R6AK1Engu1+/nGhfK7R5bjtwGnXdFfpSJ6190Quz5grqQCC048lFXMhy2nQZWkUVsRowZv8OvLOPCvdHwE5APyKRSMQzfwE22DtT3T5PPwAAAABJRU5ErkJggg==' } }, props: { @@ -235,10 +234,10 @@ clearIcon: { type: [Boolean], default: true - }, - hideSecond: { - type: [Boolean], - default: false + }, + hideSecond: { + type: [Boolean], + default: false } }, watch: { @@ -309,7 +308,7 @@ const res = activeDate === this.caleRange.endDate ? this.caleRange.endTime : '' return res }, - reactMobDefTime() { + reactMobDefTime() { const times = { start: this.tempRange.startTime, end: this.tempRange.endTime @@ -363,6 +362,11 @@ }, clearText() { return t("uni-datetime-picker.clear") + }, + showClearIcon() { + const { clearIcon, disabled, singleVal, range } = this + const bool = clearIcon && !disabled && (singleVal || (range.startDate && range.endDate)) + return bool } }, created() { @@ -377,7 +381,7 @@ // } }, mounted() { - this.platform() + this.platform() }, methods: { /** @@ -437,7 +441,7 @@ }) this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, { which: 'left' - }) + }) } }, updateLeftCale(e) { @@ -493,7 +497,7 @@ } } - }, 20) + }, 50) }, close() { @@ -685,9 +689,9 @@ this.tempSingleDate = '' this.time = '' if (this.isPhone) { - this.$refs.mobile.clearCalender() + this.$refs.mobile && this.$refs.mobile.clearCalender() } else { - this.$refs.pcSingle.clearCalender() + this.$refs.pcSingle && this.$refs.pcSingle.clearCalender() } if (needEmit) { this.formItem && this.formItem.setValue('') @@ -698,16 +702,16 @@ } else { this.range.startDate = '' this.range.endDate = '' - this.tempRange.startDate= '' - this.tempRange.startTime= '' - this.tempRange.endDate= '' - this.tempRange.endTime= '' + this.tempRange.startDate = '' + this.tempRange.startTime = '' + this.tempRange.endDate = '' + this.tempRange.endTime = '' if (this.isPhone) { - this.$refs.mobile.clearCalender() + this.$refs.mobile && this.$refs.mobile.clearCalender() } else { - this.$refs.left.clearCalender() - this.$refs.right.clearCalender() - this.$refs.right.next() + this.$refs.left && this.$refs.left.clearCalender() + this.$refs.right && this.$refs.right.clearCalender() + this.$refs.right && this.$refs.right.next() } if (needEmit) { this.formItem && this.formItem.setValue([]) @@ -728,7 +732,8 @@ const minute = defVal.getMinutes() const second = defVal.getSeconds() const defDate = year + '-' + this.lessTen(month) + '-' + this.lessTen(day) - const defTime = this.lessTen(hour) + ':' + this.lessTen(minute) + (this.hideSecond ? '' : (':' + this.lessTen(second))) + const defTime = this.lessTen(hour) + ':' + this.lessTen(minute) + (this.hideSecond ? '' : (':' + this + .lessTen(second))) return { defDate, defTime @@ -782,12 +787,11 @@ .uni-date-editor--x .uni-date__icon-clear { position: absolute; - top: 5px; + top: 0; right: 0; display: inline-block; box-sizing: border-box; - border: 6px solid transparent; - margin-right: 6px; + border: 9px solid transparent; /* #ifdef H5 */ cursor: pointer; /* #endif */ @@ -846,8 +850,8 @@ position: absolute; top: 0; z-index: 999; - border: 1px solid #e4e7ed; - box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%); + border: 1px solid #EBEEF5; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 4px; } @@ -857,8 +861,8 @@ position: absolute; top: 0; z-index: 999; - border: 1px solid #e4e7ed; - box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%); + border: 1px solid #EBEEF5; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 4px; } @@ -899,7 +903,7 @@ border-top-color: #F1F1F1; border-top-style: solid; border-top-width: 1px; - background-color: #fff; + /* background-color: #fff; */ line-height: 40px; text-align: right; color: #666; @@ -917,7 +921,7 @@ } .uni-date-changed { - background-color: #fff; + /* background-color: #fff; */ text-align: center; color: #333; border-bottom-color: #F1F1F1; @@ -946,7 +950,32 @@ margin-right: 50px; } - .uni-date_calendar-pc { - padding: 0 6px; + /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ + .uni-popper__arrow, + .uni-popper__arrow::after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 6px; + } + + .uni-popper__arrow { + filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); + top: -6px; + left: 10%; + margin-right: 3px; + border-top-width: 0; + border-bottom-color: #EBEEF5; + } + + .uni-popper__arrow::after { + content: " "; + top: 1px; + margin-left: -6px; + border-top-width: 0; + border-bottom-color: #fff; } - + diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js index 18b91c36d5177db28f7a36fcad300a06973be3b5..882f006419cca0145b8ec3c775b86547de16f930 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js @@ -1,5 +1,3 @@ -import CALENDAR from './calendar.js' - class Calendar { constructor({ date, @@ -112,7 +110,6 @@ class Calendar { dateArr.push({ date: beforeDate, month: full.month - 1, - lunar: this.getlunar(full.year, full.month - 1, beforeDate), disable: true }) } @@ -123,7 +120,7 @@ class Calendar { */ _currentMonthDys(dateData, full) { let dateArr = [] - let fullDate = this.date.fullDate + let fullDate = this.date.fullDate for (let i = 1; i <= dateData; i++) { let isinfo = false let nowDate = full.year + '-' + (full.month < 10 ? @@ -164,16 +161,15 @@ class Calendar { if (multiplesStatus !== -1) { checked = true } - } + } let data = { fullDate: nowDate, year: full.year, date: i, multiple: this.range ? checked : false, - beforeMultiple: this.dateEqual(this.multipleStatus.before, nowDate), - afterMultiple: this.dateEqual(this.multipleStatus.after, nowDate), + beforeMultiple: this.isLogicBefore(nowDate, this.multipleStatus.before, this.multipleStatus.after), + afterMultiple: this.isLogicAfter(nowDate, this.multipleStatus.before, this.multipleStatus.after), month: full.month, - lunar: this.getlunar(full.year, full.month, i), disable: !(disableBefore && disableAfter), isDay, userChecked: false @@ -195,7 +191,6 @@ class Calendar { dateArr.push({ date: i, month: Number(full.month) + 1, - lunar: this.getlunar(full.year, Number(full.month) + 1, i), disable: true }) } @@ -243,7 +238,26 @@ class Calendar { return false } } - + + /** + * 比较真实起始日期 + */ + + isLogicBefore(currentDay, before, after) { + let logicBefore = before + if (before && after) { + logicBefore = this.dateCompare(before, after) ? before : after + } + return this.dateEqual(logicBefore, currentDay) + } + + isLogicAfter(currentDay, before, after) { + let logicAfter = after + if (before && after) { + logicAfter = this.dateCompare(before, after) ? after : before + } + return this.dateEqual(logicAfter, currentDay) + } /** * 获取日期范围内所有日期 @@ -266,19 +280,6 @@ class Calendar { } return arr } - /** - * 计算阴历日期显示 - */ - getlunar(year, month, date) { - return CALENDAR.solar2lunar(year, month, date) - } - /** - * 设置打点 - */ - setSelectInfo(data, value) { - this.selected = value - this._getWeek(data) - } /** * 获取多选状态 @@ -287,8 +288,7 @@ class Calendar { let { before, after - } = this.multipleStatus - + } = this.multipleStatus if (!this.range) return if (before && after) { if (!this.lastHover) { @@ -301,9 +301,9 @@ class Calendar { this.multipleStatus.fulldate = '' this.lastHover = false } else { - this.lastHover = false if (!before) { - this.multipleStatus.before = fullDate + this.multipleStatus.before = fullDate + this.lastHover = false } else { this.multipleStatus.after = fullDate if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) { @@ -312,7 +312,8 @@ class Calendar { } else { this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus .before); - } + } + this.lastHover = true } } this._getWeek(fullDate) diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json index 5c3f88af904d968676dc85190e678c1ff9d279f1..5e0ff11e9ae573adca99828f0a617170f49f2668 100644 --- a/uni_modules/uni-datetime-picker/package.json +++ b/uni_modules/uni-datetime-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-datetime-picker", "displayName": "uni-datetime-picker 日期选择器", - "version": "2.1.4", + "version": "2.2.2", "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", "keywords": [ "uni-datetime-picker", @@ -42,6 +42,7 @@ }, "uni_modules": { "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], diff --git a/uni_modules/uni-datetime-picker/readme.md b/uni_modules/uni-datetime-picker/readme.md index 37b5344b918841aaeda9d64495e624b9e2d86ccf..162fbefaa37da718b549160cfe60c8a2fd30d4e6 100644 --- a/uni_modules/uni-datetime-picker/readme.md +++ b/uni_modules/uni-datetime-picker/readme.md @@ -1,6 +1,9 @@ + > `重要通知:组件升级更新 2.0.0 后,支持日期+时间范围选择,组件 ui 将使用日历选择日期,ui 变化较大,同时支持 PC 和 移动端。此版本不向后兼容,不再支持单独的时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)。若仍需使用旧版本,可在插件市场下载*非uni_modules版本*,旧版本将不再维护` + ## DatetimePicker 时间选择器 + > **组件名:uni-datetime-picker** > 代码块: `uDatetimePicker` @@ -9,151 +12,10 @@ 若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。 - -___点击 picker 默认值规则:___ +**_点击 picker 默认值规则:_** - 若设置初始值 value, 会显示在 picker 显示框中 - 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - -``` - -## API - -### DatetimePicker Props - -|属性名 |类型 |默认值 |值域 |说明 | -|:-: |:-: |:-: | |:-: | -|type |String |datetime |date/daterange/datetime/datetimerange|选择器类型 | -|value |String、Number、Array(范围选择)、Date|- |- |输入框当前值 | -|start |String、Number |- |- |最小值,可以使用日期的字符串(String)、时间戳(Number) | -|end |String、Number |- |- |最大值,可以使用日期的字符串(String)、时间戳(Number) | -|return-type |String |string |timestamp 、string、date |返回值格式 | -|border |Boolean |true | |是否有边框 | -|rangeSeparator |String |'-' |- |选择范围时的分隔符 | -|placeholder |String |- |- |非范围选择时的占位内容 | -|start-placeholder|String |- |- |范围选择时开始日期的占位内容 | -|end-placeholder |String |- |- |范围选择时结束日期的占位内容 | -|disabled |Boolean |false | |是否不可选择 | -|clear-icon |Boolean |true | |是否显示清除按钮 | -|hide-second |Boolean |false | |是否显示秒,只显示时分 | - - - - -### DatetimePicker Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|change |确定日期时间时触发的事件,参数为当前选择的日期对象 |单选返回日期字符串,如:'2010-02-3';范围选返回日期字符串数组,如:['2020-10-1', '2021-4-1'] | -|maskClick|点击遮罩层触发 |- | - -### Popup Methods - -|方法称名 |说明|参数| -|:-:|:-:|:-:| -|show|打开弹出层|-| -|close|关闭弹出层 |-| -|clear|清除上次选中的状态和值|-| - - ### - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/datetime-picker/datetime-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/datetime-picker/datetime-picker) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-drawer/changelog.md b/uni_modules/uni-drawer/changelog.md index 4077ce1c7bc2395b11e54e36fe987409da90d421..b9e7637ed06e631102495c11b01ba577f2617b37 100644 --- a/uni_modules/uni-drawer/changelog.md +++ b/uni_modules/uni-drawer/changelog.md @@ -1,5 +1,10 @@ -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.2.1(2021-11-22) +- 修复 vue3中个别scss变量无法找到的问题 +## 1.2.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-drawer](https://uniapp.dcloud.io/component/uniui/uni-drawer) +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.1.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) diff --git a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue index 253d7f502cf32ba8cc27b95d46f98ae5c76514b7..5b551e3c3bcdf735367ef054c7a1730436613435 100644 --- a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue +++ b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue @@ -105,7 +105,8 @@ } - diff --git a/uni_modules/uni-easyinput/package.json b/uni_modules/uni-easyinput/package.json index 408a182e8574e75949901b52ff531ceb5fc3e506..912b837571bfbb2c09c1e064b74b8165e9793ca4 100644 --- a/uni_modules/uni-easyinput/package.json +++ b/uni_modules/uni-easyinput/package.json @@ -1,7 +1,7 @@ { "id": "uni-easyinput", "displayName": "uni-easyinput 增强输入框", - "version": "0.1.4", + "version": "1.0.0", "description": "Easyinput 组件是对原生input组件的增强", "keywords": [ "uni-ui", @@ -41,7 +41,8 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [ + "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -81,7 +82,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-easyinput/readme.md b/uni_modules/uni-easyinput/readme.md index ab6c50bf4107aff9cff2e01c44e1f89b949657e1..f1faf8fbbba31f9f404116b32078b1603487d279 100644 --- a/uni_modules/uni-easyinput/readme.md +++ b/uni_modules/uni-easyinput/readme.md @@ -7,192 +7,5 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能 - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 平台差异说明 - -暂不支持在nvue页面中使用 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -输入内容后,输入框尾部会显示清除按钮,点击可清除内容,如不需要展示图标,`clearable` 属性设置为 `false` 即可 - -`clearable` 属性设置为 `true` ,输入框聚焦且内容不为空时,才会显示内容 - -```html - -``` - - -### 输入框带左右图标 - -设置 `prefixIcon` 属性来显示输入框的头部图标 - -设置 `suffixIcon` 属性来显示输入框的尾部图标 - -注意图标当前只支持 `uni-icons` 内置的图标,当配置 `suffixIcon` 属性后,会覆盖 `:clearable="true"` 和 `type="password"` 时的原有图标 - -绑定 `@iconClick` 事件可以触发图标的点击 ,返回 `prefix` 表示点击左侧图标,返回 `suffix` 表示点击右侧图标 - -```html - - - - - -``` - -### 输入框禁用 - -设置 `disable` 属性可以禁用输入框,此时输入框不可编辑 - -```html - -``` - -### 密码框 - -设置 `type="password"` 时,输入框内容将会不可见,由实心点代替,同时输入框尾部会显示眼睛图标,点击可切换内容显示状态 - -```html - -``` - -### 输入框聚焦 - -设置 `focus` 属性可以使输入框聚焦 - -如果页面存在多个设置 `focus` 属性的输入框,只有最后一个输入框的 `focus` 属性会生效 - -```html - -``` - - -### 多行文本 - -设置 `type="textarea"` 时可输入多行文本 - -```html - -``` - -### 多行文本自动高度 - -设置 `type="textarea"` 时且设置 `autoHeight` 属性,可使用多行文本的自动高度,会跟随内容调整输入框的显示高度 - -```html - -``` - -### 取消边框 - -设置 `:inputBorder="false"` 时可取消输入框的边框显示,同时搭配 `uni-forms` 的 `:border="true"` 有较好的效果 - -```html - - - - - - - - -``` - - -## API - -### Easyinput Props - -|属性名| 类型| 可选值|默认值|说明| -|:-:|:-:|:-:|:-:|:-:| -|value|String/ Number|-|-|输入内容| -|type|String|见 type Options|text|输入框的类型(默认text)| -|clearable|Boolean|-|true| 是否显示右侧清空内容的图标控件(输入框有内容且不禁用时显示),点击可清空输入框内容| -|autoHeight|Boolean|-|false| 是否自动增高输入区域,type为textarea时有效| -|placeholder|String |-| - | 输入框的提示文字| -|placeholderStyle|String| - | - | placeholder的样式(内联样式,字符串),如"color: #ddd"| -|focus|Boolean|-|false|是否自动获得焦点| -|disabled|Boolean|-|false|是否不可输入| -|maxlength|Number|-|140|最大输入长度,设置为 -1 的时候不限制最大长度| -|confirmType|String|-|done|设置键盘右下角按钮的文字,仅在type="text"时生效| -|clearSize|Number|-|15|清除图标的大小,单位px| -|prefixIcon|String|-|-|输入框头部图标 | -|suffixIcon|String|-|-|输入框尾部图标| -|trim|Boolean/String|见 trim Options | false | 是否自动去除空格,传入类型为 Boolean 时,自动去除前后空格| -|inputBorder|Boolean|-|true|是否显示input输入框的边框| -|styles|Object|-|-| 样式自定义| -|passwordIcon|Boolean|-| true | type=password 时,是否显示小眼睛图标| - - -#### Type Options - -|属性名| 说明| -|:-:| :-:| -|text|文本输入键盘| -|textarea |多行文本输入键盘| -|password |密码输入键盘| -|number|数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式 | -|idcard|身份证输入键盘,仅支持微信、支付宝、百度、QQ小程序| -|digit|带小数点的数字键盘,仅支持微信、支付宝、百度、头条、QQ小程序 | - -#### ConfirmType Options - -平台差异与 [input](https://uniapp.dcloud.io/component/input) 相同 - -|属性名 | 说明| -|:-:| :-:| -|send|右下角按钮为“发送” | -|search |右下角按钮为“搜索” | -|next|右下角按钮为“下一个”| -|go|右下角按钮为“前往” | -|done|右下角按钮为“完成” | - - -#### Styles Options - -|属性名| 默认值 |说明| -|:-:| :-:| :-:| -|color| #333| 输入文字颜色| -|disableColor |#eee| 输入框禁用背景色| -|borderColor |#e5e5e5 | 边框颜色| - -#### Trim Options - -传入类型为 `Boolean` 时,自动去除前后空格,传入类型为 `String` 时,可以单独控制,下面是可选值 - -|属性名|说明| -|:-:| :-:| -|both|去除两端空格| -|left|去除左侧空格| -|right|去除右侧空格| -|all|去除所有空格| -|none|不去除空格| - - -### Easyinput Events - -|事件称名| 说明|返回值| -|:-:| :-:|:-:| -|@input|输入框内容发生变化时触发| -| -|@focus|输入框获得焦点时触发| -| -|@blur|输入框失去焦点时触发| -| -|@confirm|点击完成按钮时触发| -| -|@iconClick |点击图标时触发| prefix/suffix | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/easyinput/easyinput](https://hellouniapp.dcloud.net.cn/pages/extUI/easyinput/easyinput) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-fab/changelog.md b/uni_modules/uni-fab/changelog.md index 1895c7d7acf1dad0da2edebf9dd4e41b8ce51f9e..24e26b1671be9fdec8bff65c3a7895f31719aace 100644 --- a/uni_modules/uni-fab/changelog.md +++ b/uni_modules/uni-fab/changelog.md @@ -1,8 +1,17 @@ +## 1.2.2(2021-12-29) +- 更新 组件依赖 +## 1.2.1(2021-11-19) +- 修复 阴影颜色不正确的bug +## 1.2.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-fab](https://uniapp.dcloud.io/component/uniui/uni-fab) +## 1.1.1(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-02-05) -- 调整为uni_modules目录规范 -- 优化 按钮背景色调整 -- 优化 兼容pc端 +## 1.0.7(2021-05-12) +- 新增 组件示例地址 +## 1.0.6(2021-02-05) +- 调整为uni_modules目录规范 +- 优化 按钮背景色调整 +- 优化 兼容pc端 diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue index 599a2d4996d50263e5514f02d38aac6879b758a1..6143a0552a6eedb00697954dde93bf595ab6426c 100644 --- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue +++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue @@ -5,8 +5,7 @@ 'uni-fab--rightBottom': rightBottom, 'uni-fab--leftTop': leftTop, 'uni-fab--rightTop': rightTop - }" - class="uni-fab"> + }" class="uni-fab"> + }" :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }" + class="uni-fab__content" elevation="5"> - - - {{ item.text }} + + + {{ item.text }} @@ -32,10 +32,11 @@ 'uni-fab__circle--leftTop': leftTop, 'uni-fab__circle--rightTop': rightTop, 'uni-fab__content--other-platform': !isAndroidNvue - }" - class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick"> - - + }" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick"> + + @@ -67,7 +68,7 @@ */ export default { name: 'UniFab', - emits:['fabClick','trigger'], + emits: ['fabClick', 'trigger'], props: { pattern: { type: Object, @@ -111,16 +112,17 @@ color: '#3c3e49', selectedColor: '#007AFF', backgroundColor: '#fff', - buttonColor: '#007AFF' + buttonColor: '#007AFF', + iconColor: '#fff' } } }, computed: { contentWidth(e) { - return (this.content.length + 1) * 55 + 10 + 'px' + return (this.content.length + 1) * 55 + 15 + 'px' }, contentWidthMin() { - return 55 + 'px' + return '55px' }, // 动态计算宽度 boxWidth() { @@ -159,9 +161,11 @@ } }, watch: { - pattern(newValue, oldValue) { - //console.log(JSON.stringify(newValue)) - this.styles = Object.assign({}, this.styles, newValue) + pattern: { + handler(val, oldVal) { + this.styles = Object.assign({}, this.styles, val) + }, + deep: true } }, created() { @@ -173,7 +177,7 @@ this.styles = Object.assign({}, this.styles, this.pattern) }, methods: { - _onClick() { + _onClick() { this.$emit('fabClick') if (!this.popMenu) { return @@ -213,7 +217,9 @@ } - + diff --git a/uni_modules/uni-fab/package.json b/uni_modules/uni-fab/package.json index 9e71b42a16e7a81e74174a06029f29182e971299..0f27daa58062cd50946e73006091d621c90f0fd4 100644 --- a/uni_modules/uni-fab/package.json +++ b/uni_modules/uni-fab/package.json @@ -1,83 +1,87 @@ -{ - "id": "uni-fab", - "displayName": "uni-fab 悬浮按钮", - "version": "1.1.0", - "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", - "keywords": [ - "uni-ui", - "uniui", - "按钮", - "悬浮按钮", - "fab" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "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" - } - } - } - } -} +{ + "id": "uni-fab", + "displayName": "uni-fab 悬浮按钮", + "version": "1.2.2", + "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", + "keywords": [ + "uni-ui", + "uniui", + "按钮", + "悬浮按钮", + "fab" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["uni-scss","uni-icons"], + "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-fab/readme.md b/uni_modules/uni-fab/readme.md index 0ed6ce815e18c9df82034c4318051ab34ce72902..9a444e880929df1b9f7efa692b98ebf4f3ed3d8d 100644 --- a/uni_modules/uni-fab/readme.md +++ b/uni_modules/uni-fab/readme.md @@ -1,5 +1,3 @@ - - ## Fab 悬浮按钮 > **组件名:uni-fab** > 代码块: `uFab` @@ -7,85 +5,5 @@ 点击可展开一个图形按钮菜单 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 不建议动态修改属性,可能会耗损部分性能。 -> - 展开菜单暂不支持字体图标,使用图片路径时建议使用绝对路径,相对路径可能会有问题。 -> - 选中状态要通过自己控制,如果不希望有选中状态,不处理 `active` 即可。 -> - 展开菜单建议最多显示四个,如果过多对于小屏手机可能会超出屏幕。 - - -### 基本用法 - -在 `template` 中使用组件 - -```html - -``` - - -## API - -### Fab Props - -| 属性名 | 类型 | 默认值 | 说明 | -| :-: | :-: | :-: | :-: | -| pattern | Object | - | 可选样式配置项 | -| horizontal| String | 'left' | 水平对齐方式。`left`:左对齐,`right`:右对齐 | -| vertical | String | 'bottom' | 垂直对齐方式。`bottom`:下对齐,`top`:上对齐 | -| direction | String | 'horizontal' | 展开菜单显示方式。`horizontal`:水平显示,`vertical`:垂直显示 | -| popMenu | Boolean | true | 是否使用弹出菜单 | -| content | Array | - | 展开菜单内容配置项 | - - - -**pattern配置项:** - -| 参数 | 类型 | 默认值 | 说明 | -| :-: | :-: | :-: | :-: | -| color | String | #3c3e49 | 文字默认颜色 | -| selectedColor | String | #007AFF | 文字选中时的颜色 | -| backgroundColor | String | #ffffff | 背景色 | -| buttonColor | String | #3c3e49 | 按钮背景色 | - -**content配置项:** - -| 参数 | 类型 | 说明 | -| :-: | :-: | :-: | :-: | -| iconPath | String | 图片路径 | -| selectedIconPath | String | 选中后图片路径| -| text | String | 文字 | -| active | Boolean | 是否选中当前 | - -### Fab Events - -| 参数 | 类型 | 说明 | -| :-: | :-: | :-: | -| @trigger | Function | 展开菜单点击事件,返回点击信息| -| @fabClick | Function | 悬浮按钮点击事件 | - - - - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/fab/fab](https://hellouniapp.dcloud.net.cn/pages/extUI/fab/fab) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fab) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-fav/changelog.md b/uni_modules/uni-fav/changelog.md index f35b81748e84866247f8d42fd67e10fbf59584da..3306494f01e96ce53b206716705b57c81b272391 100644 --- a/uni_modules/uni-fav/changelog.md +++ b/uni_modules/uni-fav/changelog.md @@ -1,14 +1,17 @@ -## 1.1.1(2021-08-24) -- 新增 支持国际化 -## 1.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.6(2021-05-12) -- 新增 组件示例地址 -## 1.0.5(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 1.0.4(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.0.3(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.0.2(2021-02-05) -- 调整为uni_modules目录规范 +## 1.2.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-fav](https://uniapp.dcloud.io/component/uniui/uni-fav) +## 1.1.1(2021-08-24) +- 新增 支持国际化 +## 1.1.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.6(2021-05-12) +- 新增 组件示例地址 +## 1.0.5(2021-04-21) +- 优化 添加依赖 uni-icons, 导入后自动下载依赖 +## 1.0.4(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.0.3(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.0.2(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue index b86424586d3596d8c7a11ec35285d402783b6924..84dc89800519812342d849f828b128224a9bff9e 100644 --- a/uni_modules/uni-fav/components/uni-fav/uni-fav.vue +++ b/uni_modules/uni-fav/components/uni-fav/uni-fav.vue @@ -102,7 +102,7 @@ }, methods: { onClick() { - this.$emit("click"); + this.$emit("click"); } } }; @@ -146,11 +146,11 @@ .uni-fav-text { /* #ifndef APP-NVUE */ display: flex; - /* #endif */ + /* #endif */ height: $fav-height; line-height: $fav-height; align-items: center; justify-content: center; - font-size: $uni-font-size-base; + font-size: 12px; } diff --git a/uni_modules/uni-fav/package.json b/uni_modules/uni-fav/package.json index 0556086716f4f1f4035bdfdb781d0ed1d5712939..b06d32d6c68e34a291b51a0efe739578517126c4 100644 --- a/uni_modules/uni-fav/package.json +++ b/uni_modules/uni-fav/package.json @@ -1,88 +1,89 @@ -{ - "id": "uni-fav", - "displayName": "uni-fav 收藏按钮", - "version": "1.1.1", - "description": " Fav 收藏组件,可自定义颜色、大小。", - "keywords": [ - "fav", - "uni-ui", - "uniui", - "收藏" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { +{ + "id": "uni-fav", + "displayName": "uni-fav 收藏按钮", + "version": "1.2.0", + "description": " Fav 收藏组件,可自定义颜色、大小。", + "keywords": [ + "fav", + "uni-ui", + "uniui", + "收藏" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { "dependencies": [ - "uni-icons" - ], - "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": "u" - } - } - } - } -} + "uni-scss", + "uni-icons" + ], + "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-fav/readme.md b/uni_modules/uni-fav/readme.md index 83a01fca35e333c3f942680915632fa0c99a5a8b..4de125d2819979260ad83fa2218e19d7d4754025 100644 --- a/uni_modules/uni-fav/readme.md +++ b/uni_modules/uni-fav/readme.md @@ -4,47 +4,7 @@ > **组件名:uni-fav** > 代码块: `uFav` - 用于收藏功能,可点击切换选中、不选中的状态。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - -``` - -## API - -### Fav Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|star |Boolean|true |按钮是否带星星 | -|bgColor |String |#eeeeee |未收藏时的背景色 | -|bgColorChecked |String |#007aff |已收藏时的背景色 | -|fgColor |String |#666666 |未收藏时的文字颜色 | -|fgColorChecked |String |#FFFFFF |已收藏时的文字颜色 | -|circle |Boolean|false |是否为圆角 | -|checked |Boolean|false |是否为已收藏 | -|contentText |Object |```{contentDefault: '收藏',contentFav: '已收藏'}```|收藏按钮文字 | - - -### Fav Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|click |点击 fav按钮 触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/fav/fav](https://hellouniapp.dcloud.net.cn/pages/extUI/fav/fav) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fav) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-feedback/changelog.md b/uni_modules/uni-feedback/changelog.md index 57c13b89d8bcfe95c907caaef24304a6624980bf..00d331fce4a42e46c17ebb491920a7bbb61623b2 100644 --- a/uni_modules/uni-feedback/changelog.md +++ b/uni_modules/uni-feedback/changelog.md @@ -1,2 +1,4 @@ +## 1.0.4(2021-09-26) +为了数据安全,`opendb-feedback`表的`permission`中`delete`,`update`的值默认为`false` ## 1.0.3(2021-08-26) -删除多余的云函数test2 +删除多余的云函数test2 \ No newline at end of file diff --git a/uni_modules/uni-feedback/package.json b/uni_modules/uni-feedback/package.json index fb20e7a1bfc276d8de38e66bc21912e430295d7c..a564d08505e9f9346c944aee87a71930e0431e07 100644 --- a/uni_modules/uni-feedback/package.json +++ b/uni_modules/uni-feedback/package.json @@ -1,10 +1,10 @@ { "id": "uni-feedback", - "displayName": "问题反馈用户端页面模板", - "version": "1.0.3", - "description": "问题反馈用户端页面模板,方便开发者快速搭建问题反馈界面", + "displayName": "问题反馈页面模板", + "version": "1.0.4", + "description": "问题反馈页面模板,方便开发者快速搭建问题反馈界面", "keywords": [ - "问题反馈用户端页面模板" + "问题反馈页面模板" ], "repository": "", "engines": { diff --git a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue index 9c30b673f484ec0f120b7efabfd67178b0746358..40db16bf6d4144e07035b376df32e8e92aa1ee53 100644 --- a/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue +++ b/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue @@ -26,6 +26,7 @@ import { validator } from '../../js_sdk/validator/opendb-feedback.js'; + console.log(validator); const db = uniCloud.database(); const dbCollectionName = 'opendb-feedback'; diff --git a/uni_modules/uni-feedback/readme.md b/uni_modules/uni-feedback/readme.md index aa0ede5e64cc25f1fab0f667d2e2bf5522571d01..65d91928ee5dd77fc5f6ebf5bff7c21f777f73cf 100644 --- a/uni_modules/uni-feedback/readme.md +++ b/uni_modules/uni-feedback/readme.md @@ -1,2 +1 @@ -这是一个问题反馈客户端插件,admin端插件:[https://ext.dcloud.net.cn/plugin?id=4992](https://ext.dcloud.net.cn/plugin?id=4992) -> 参考案例 [uni-starter](https://ext.dcloud.net.cn/plugin?id=5057) \ No newline at end of file +这是一个问题反馈客户端插件,admin端插件:[https://ext.dcloud.net.cn/plugin?id=4992](https://ext.dcloud.net.cn/plugin?id=4992) \ No newline at end of file diff --git a/uni_modules/uni-file-picker/changelog.md b/uni_modules/uni-file-picker/changelog.md index 82bc093d931e4ed56b37b79ab9a90f8b7a1443f9..a01f9bab203f9eb2869e32d89e742ced0bfdfcf4 100644 --- a/uni_modules/uni-file-picker/changelog.md +++ b/uni_modules/uni-file-picker/changelog.md @@ -1,5 +1,14 @@ -## 0.2.14(2021-08-23) -- 新增 参数中返回 fileID 字段 +## 1.0.1(2021-11-23) +- 修复 参数为对象的情况下,url在某些情况显示错误的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-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker) +## 0.2.16(2021-11-08) +- 修复 传入空对象 ,显示错误的Bug +## 0.2.15(2021-08-30) +- 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug +## 0.2.14(2021-08-23) +- 新增 参数中返回 fileID 字段 ## 0.2.13(2021-08-23) - 修复 腾讯云传入fileID 不能回显的bug - 修复 选择图片后,不能放大的问题 diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue index ba4d742e367ba4e38e705d2371d1b9f15d6606e9..48c834ab5e2be094e265cb954bad8b714d5825d9 100644 --- a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue +++ b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue @@ -278,7 +278,6 @@ files.push(Object.assign({}, v)) } }) - this.uploadFiles(files) }, async setValue(newVal, oldVal) { @@ -293,8 +292,8 @@ if (reg.test(url)) { v.fileID = url v.url = await this.getTempFileURL(url) - } - v.path = v.url + } + if(v.url) v.path = v.url return v } if (this.returnType === 'object') { @@ -439,7 +438,7 @@ for (let i = 0; i < res.length; i++) { const item = res[i] const index = item.uuid ? this.files.findIndex(p => p.uuid === item.uuid) : item.index - + if (index === -1 || !this.files) break if (item.errMsg === 'request:fail') { this.files[index].url = item.path @@ -457,7 +456,7 @@ }else{ this.files[index].url = item.url } - + this.files[index].status = 'success' this.files[index].progress += 1 successData.push(this.files[index]) @@ -521,7 +520,7 @@ this.setEmit() }) }, - + /** * 获取文件名和后缀 * @param {Object} name @@ -542,8 +541,7 @@ let data = [] if (this.returnType === 'object') { data = this.backObject(this.files)[0] - this.localValue = {} - Object.assign(this.localValue, data) + this.localValue = data?data:null } else { data = this.backObject(this.files) if (!this.localValue) { diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue index 6b1741d9a1acae86e978225a414380b3ddd4ca93..51ace0b4e385a6577c4386738516b6a4cefe1574 100644 --- a/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue +++ b/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue @@ -116,13 +116,15 @@ let { border } = this.styles - let obj = {} + let obj = {} + const widthDefaultValue = 1 + const radiusDefaultValue = 3 if (typeof border === 'boolean') { obj.border = border ? '1px #eee solid' : 'none' } else { - let width = (border && border.width) || 1 + let width = (border && border.width) || widthDefaultValue width = this.value2px(width) - let radius = (border && border.radius) || 5 + let radius = (border && border.radius) || radiusDefaultValue radius = this.value2px(radius) obj = { 'border-width': width, @@ -206,7 +208,7 @@ left: 0; margin: 5px; border: 1px #eee solid; - border-radius: 8px; + border-radius: 5px; overflow: hidden; } @@ -271,8 +273,8 @@ align-items: center; justify-content: center; position: absolute; - top: 5px; - right: 5px; + top: 3px; + right: 3px; height: 26px; width: 26px; border-radius: 50%; diff --git a/uni_modules/uni-file-picker/package.json b/uni_modules/uni-file-picker/package.json index 1379d29b9814e1858e6eddc4a055f92db3c64e31..29df9f7220eb9d7fe45764b891bc4ec04081c185 100644 --- a/uni_modules/uni-file-picker/package.json +++ b/uni_modules/uni-file-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-file-picker", "displayName": "uni-file-picker 文件选择上传", - "version": "0.2.14", + "version": "1.0.1", "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-file-picker/readme.md b/uni_modules/uni-file-picker/readme.md index 496327b7f2e9961d2333a315ca7af8a4bf743c75..25519626718b3897e0a2d31986e61db6882d1615 100644 --- a/uni_modules/uni-file-picker/readme.md +++ b/uni_modules/uni-file-picker/readme.md @@ -1,305 +1,11 @@ - -## FilePicker 文件选择上传 - -> **组件名:uni-file-picker** -> 代码块: `uFilePicker` - - -文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间 - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 如不绑定服务空间,`autoUpload`默认为`false`且不可更改 -> - 选择文件目前只支持 `H5` 和 `微信小程序平台` ,且 `微信小程序平台` 使用 `wx.chooseMessageFile()` -> - v-model 值需要自动上传成功后才会绑定值,一般只用来回显数据 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - -## API - -### FilePicker Props - -| 属性名 | 类型 | 默认值 | 可选值 | 说明 | -| :-: | :-: | :-: | :-: | :-: | -| v-model/value | Array\Object | - | - | 组件数据,通常用来回显 ,类型由`return-type`属性决定 ,**格式见下文** | -| disabled | Boolean | false | - | 组件禁用 | -| readonly | Boolean | false | - | 组件只读,不可选择,不显示进度,不显示删除按钮 | -| return-type | String | array | array/object | 限制 `value` 格式,当为 `object` 时 ,组件只能单选,且会覆盖 | -| disable-preview| Boolean | false | - | 禁用图片预览,仅 `mode:grid`生效 | -| del-icon | Boolean | true | - | 是否显示删除按钮 | -| auto-upload | Boolean | true | - | 是否自动上传,值为`true`则只触发@select,可自行上传| -| limit | Number\String | 9 | - | 最大选择个数 ,h5 会自动忽略多选的部分 | -| title | String | - | - | 组件标题,右侧显示上传计数 | -| mode | String | list | list/grid | 选择文件后的文件列表样式 | -| file-mediatype| String | image | image/video/all | 选择文件类型,all 只支持 H5 和微信小程序平台 | -| file-extname | Array\String | - | - | 选择文件后缀,字符串的情况下需要用逗号分隔(推荐使用字符串),根据 `file-mediatype` 属性而不同| -| list-styles | Object | - | - | `mode:list` 时的样式 | -| image-styles | Object | - | - | `mode:grid` 时的样式 | - - -### value 格式 - -三个属性必填,否则影响组件显示 - -```json -[ - { - "name":"file.txt", - "extname":"txt", - "url":"https://xxxx", - // ... - } -] - -``` - -### list-styles 格式 - -```json -{ - "borderStyle":{ - "color":"#eee", // 边框颜色 - "width":"1px", // 边框宽度 - "style":"solid", // 边框样式 - "radius":"5px" // 边框圆角,不支持百分比 - }, - "border":false, // 是否显示边框 - "dividline":true // 是否显示分隔线 -} -``` - -### image-styles 格式 - -```json -{ - "height": 60, // 边框高度 - "width": 60, // 边框宽度 - "border":{ // 如果为 Boolean 值,可以控制边框显示与否 - "color":"#eee", // 边框颜色 - "width":"1px", // 边框宽度 - "style":"solid", // 边框样式 - "radius":"50%" // 边框圆角,支持百分比 - } -} -``` - -### FilePicker Events - -|事件称名 |说明 | 返回值 | -|:-: |:-: | :-: | -|@select | 选择文件后触发 | 见下文| -|@progress|文件上传时触发 | 见下文| -|@success |上传成功触发 | 见下文| -|@fail |上传失败触发 | 见下文| -|@delete |文件从列表移除时触发| 见下文| - - -#### Callback Params - -`**注意**:如果绑定的是腾讯云的服务空间 ,tempFilePaths 将返回 fileID` - -```json -{ - "progress" : Number, // 上传进度 ,仅 @progress 事件包含此字段 - "index" : Number, // 上传文件索引 ,仅 @progress 事件包含此字段 - "tempFile" : file, // 当前文件对象 ,包含文件流,文件大小,文件名称等,仅 @progress 事件包含此字段 - "tempFiles" : files, // 文件列表,包含文件流,文件大小,文件名称等 - "tempFilePaths" : filePaths, // 文件地址列表,@sucess 事件为上传后的线上文件地址 -} - -``` - - -### FilePicker Methods - -通过 `$ref` 调用 - -| 方法称名 | 说明 | 参数 | -| :-: | :-: | :-: | -| upload() | 手动上传 ,如`autoUpload`为`false` ,必须调用此方法| - | -| clearFiles(index:Number) | 清除选择结果| 传如 Number 为删除指定下标的文件 ,不传为删除所有| - -### FilePicker Slots - -插槽可定义上传按钮显示样式 - -| 插槽名 | 说明 | -| :-: | :-: | -| default |默认插槽| - -## 组件用法 - -### 基础用法 - -```html - -``` - -```javascript -export default { - data() { - return { - imageValue:[] - } - }, - methods:{ - // 获取上传状态 - select(e){ - console.log('选择文件:',e) - }, - // 获取上传进度 - progress(e){ - console.log('上传进度:',e) - }, - - // 上传成功 - success(e){ - console.log('上传成功') - }, - - // 上传失败 - fail(e){ - console.log('上传失败:',e) - } - } -} - -``` - -### 选择指定后缀图片,且限制选择个数 - -配置 `file-mediatype` 属性为 `image`,限定只选择图片 - -配置 `file-extname` 属性为 `'png,jpg'`,限定只选择 `png`和`jpg`后缀的图片 - -配置 `limit` 属性为 1 ,则最多选择一张图片 - -配置 `mode` 属性为 `grid` ,可以使用九宫格样式选择图片 - - -```html - -``` - -### 手动上传 - -配置 `auto-upload` 属性为 `false` ,可以停止自动上传,通过`ref`调用`upload`方法自行选择上传时机 - -```html - - - - -``` - -```javascript -export default { - data() {}, - methods:{ - upload(){ - this.$refs.files.upload() - } - } -} - -``` - -### 单选图片且点击再次选择 - -配置 `disable-preview` 属性为 `true`,禁用点击预览图片功能 - -配置 `del-icon` 属性为 `false`,隐藏删除按钮 - -配置 `return-type` 属性为 `object`,设置 `value` 类型 ,如需绑定 `array`类型 ,则设置`limit:1`,可达到一样的效果 - - - -```html -选择头像 -``` - -### 自定义样式 - -配置 `image-styles` 属性,可以自定义`mode:image`时的回显样式 - -配置 `list-styles` 属性,可以自定义`mode:video|| mode:all`时的回显样式 - -```html - - - - -``` - -```javascript -export default { - data() { - imageStyles:{ - width:64, - height:64, - border:{ - color:"#ff5a5f", - width:2, - style:'dashed', - radius:'2px' - } - }, - listStyles:{ - // 是否显示边框 - border: true, - // 是否显示分隔线 - dividline: true, - // 线条样式 - borderStyle: { - width:1, - color:'blue', - radius:2 - } - } - } -} - -``` - - - -### 使用插槽 - -使用默认插槽可以自定义选择文件按钮样式 - -```html - - - -``` - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker) \ No newline at end of file + +## FilePicker 文件选择上传 + +> **组件名:uni-file-picker** +> 代码块: `uFilePicker` + + +文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-file-picker) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-forms/changelog.md b/uni_modules/uni-forms/changelog.md index 1d19e70603b92d713220f7e9bf422343a9348863..26e120b5c0878e5d3bc2916063da30603f3c87a7 100644 --- a/uni_modules/uni-forms/changelog.md +++ b/uni_modules/uni-forms/changelog.md @@ -1,53 +1,60 @@ +## 1.3.2(2021-12-09) +- +## 1.3.1(2021-11-19) +- 修复 label 插槽不生效的bug +## 1.3.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-forms](https://uniapp.dcloud.io/component/uniui/uni-forms) ## 1.2.7(2021-08-13) - 修复 没有添加校验规则的字段依然报错的Bug -## 1.2.6(2021-08-11) -- 修复 重置表单错误信息无法清除的问题 -## 1.2.5(2021-08-11) -- 优化 组件文档 -## 1.2.4(2021-08-11) -- 修复 表单验证只生效一次的问题 -## 1.2.3(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.2.2(2021-07-26) -- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug -- 修复 1.2.1 引起的示例在小程序平台报错的Bug -## 1.2.1(2021-07-22) -- 修复 动态校验表单,默认值为空的情况下校验失效的Bug -- 修复 不指定name属性时,运行报错的Bug -- 优化 label默认宽度从65调整至70,使required为true且四字时不换行 -- 优化 组件示例,新增动态校验示例代码 -- 优化 组件文档,使用方式更清晰 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.2(2021-06-25) -- 修复 pattern 属性在微信小程序平台无效的问题 -## 1.1.1(2021-06-22) -- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug -## 1.1.0(2021-06-22) -- 修复 只写setRules方法而导致校验不生效的Bug -- 修复 由上个办法引发的错误提示文字错位的Bug -## 1.0.48(2021-06-21) -- 修复 不设置 label 属性 ,无法设置label插槽的问题 -## 1.0.47(2021-06-21) -- 修复 不设置label属性,label-width属性不生效的bug -- 修复 setRules 方法与rules属性冲突的问题 -## 1.0.46(2021-06-04) -- 修复 动态删减数据导致报错的问题 -## 1.0.45(2021-06-04) -- 新增 modelValue 属性 ,value 即将废弃 -## 1.0.44(2021-06-02) -- 新增 uni-forms-item 可以设置单独的 rules -- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤 -- 优化 submit 事件重命名为 validate -## 1.0.43(2021-05-12) -- 新增 组件示例地址 -## 1.0.42(2021-04-30) -- 修复 自定义检验器失效的问题 -## 1.0.41(2021-03-05) -- 更新 校验器 -- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug -## 1.0.40(2021-03-04) -- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug -## 1.0.39(2021-02-05) -- 调整为uni_modules目录规范 -- 修复 校验器传入 int 等类型 ,返回String类型的Bug +## 1.2.6(2021-08-11) +- 修复 重置表单错误信息无法清除的问题 +## 1.2.5(2021-08-11) +- 优化 组件文档 +## 1.2.4(2021-08-11) +- 修复 表单验证只生效一次的问题 +## 1.2.3(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.2.2(2021-07-26) +- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug +- 修复 1.2.1 引起的示例在小程序平台报错的Bug +## 1.2.1(2021-07-22) +- 修复 动态校验表单,默认值为空的情况下校验失效的Bug +- 修复 不指定name属性时,运行报错的Bug +- 优化 label默认宽度从65调整至70,使required为true且四字时不换行 +- 优化 组件示例,新增动态校验示例代码 +- 优化 组件文档,使用方式更清晰 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.2(2021-06-25) +- 修复 pattern 属性在微信小程序平台无效的问题 +## 1.1.1(2021-06-22) +- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug +## 1.1.0(2021-06-22) +- 修复 只写setRules方法而导致校验不生效的Bug +- 修复 由上个办法引发的错误提示文字错位的Bug +## 1.0.48(2021-06-21) +- 修复 不设置 label 属性 ,无法设置label插槽的问题 +## 1.0.47(2021-06-21) +- 修复 不设置label属性,label-width属性不生效的bug +- 修复 setRules 方法与rules属性冲突的问题 +## 1.0.46(2021-06-04) +- 修复 动态删减数据导致报错的问题 +## 1.0.45(2021-06-04) +- 新增 modelValue 属性 ,value 即将废弃 +## 1.0.44(2021-06-02) +- 新增 uni-forms-item 可以设置单独的 rules +- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤 +- 优化 submit 事件重命名为 validate +## 1.0.43(2021-05-12) +- 新增 组件示例地址 +## 1.0.42(2021-04-30) +- 修复 自定义检验器失效的问题 +## 1.0.41(2021-03-05) +- 更新 校验器 +- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug +## 1.0.40(2021-03-04) +- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug +## 1.0.39(2021-02-05) +- 调整为uni_modules目录规范 +- 修复 校验器传入 int 等类型 ,返回String类型的Bug diff --git a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue index b75459b3e6d72b180de8f644444e72f8672bfd73..679b12f9349692459f9fcce0932668a43a5dfa90 100644 --- a/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue +++ b/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue @@ -2,8 +2,8 @@ - - + + * {{ label }} @@ -180,32 +180,32 @@ export default { } this.init(); }, - // #ifndef VUE3 - destroyed() { - if(this.__isUnmounted) return - this.unInit() - }, - // #endif - // #ifdef VUE3 - unmounted(){ - this.__isUnmounted = true - this.unInit() - }, + // #ifndef VUE3 + destroyed() { + if(this.__isUnmounted) return + this.unInit() + }, + // #endif + // #ifdef VUE3 + unmounted(){ + this.__isUnmounted = true + this.unInit() + }, // #endif methods: { init() { if (this.form) { let { formRules, validator, formData, value, labelPosition, labelWidth, labelAlign, errShowType } = this.form; - this.labelPos = this.labelPosition ? this.labelPosition : labelPosition; - - if(this.label){ - this.labelWid = (this.labelWidth ? this.labelWidth : (labelWidth||70)) - }else{ - this.labelWid =( this.labelWidth ? this.labelWidth : (labelWidth||'auto')) - } - if(this.labelWid && this.labelWid !=='auto') { - this.labelWid +='px' - } + this.labelPos = this.labelPosition ? this.labelPosition : labelPosition; + + if(this.label){ + this.labelWid = (this.labelWidth ? this.labelWidth : (labelWidth||70)) + }else{ + this.labelWid =( this.labelWidth ? this.labelWidth : (labelWidth||'auto')) + } + if(this.labelWid && this.labelWid !=='auto') { + this.labelWid +='px' + } this.labelAli = this.labelAlign ? this.labelAlign : labelAlign; // 判断第一个 item @@ -241,16 +241,16 @@ export default { this.labelWid = this.labelWidth || 65; this.labelAli = this.labelAlign || 'left'; } - }, - unInit(){ - if (this.form) { - this.form.childrens.forEach((item, index) => { - if (item === this) { - this.form.childrens.splice(index, 1) - delete this.form.formData[item.name] - } - }) - } + }, + unInit(){ + if (this.form) { + this.form.childrens.forEach((item, index) => { + if (item === this) { + this.form.childrens.splice(index, 1) + delete this.form.formData[item.name] + } + }) + } }, /** * 获取父元素实例 @@ -293,7 +293,7 @@ export default { */ async triggerCheck(value,formTrigger) { let promise = null; - this.errMsg = ''; + this.errMsg = ''; // fix by mehaotian 解决没有检验规则的情况下,抛出错误的问题 if (!this.validator || Object.keys(this.formRules).length === 0) return; const isNoField = this.isRequired(this.formRules.rules || []); @@ -379,7 +379,7 @@ export default { }; - + diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue index d15b505b0f4dee7f43fa128e462edc44e8e290cf..dff823bb09d7681708bfe3f1be932dcdfb09efe0 100644 --- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue +++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue @@ -245,8 +245,8 @@ item.errMsg = ''; const inputComp = this.inputChildrens.find(child => child.rename === item.name); if (inputComp) { - inputComp.errMsg = ''; - // fix by mehaotian 不触发其他组件的 setValue + inputComp.errMsg = ''; + // fix by mehaotian 不触发其他组件的 setValue inputComp.is_reset = true inputComp.$emit('input', inputComp.multiple ? [] : ''); inputComp.$emit('update:modelValue', inputComp.multiple ? [] : ''); @@ -459,7 +459,7 @@ }; - + diff --git a/uni_modules/uni-forms/package.json b/uni_modules/uni-forms/package.json index d791aeb99add3868ac16de57752944b5b5e42fa8..dfa7af4c459063564c2ad3942a96a79503e6a905 100644 --- a/uni_modules/uni-forms/package.json +++ b/uni_modules/uni-forms/package.json @@ -1,89 +1,90 @@ -{ - "id": "uni-forms", - "displayName": "uni-forms 表单", - "version": "1.2.7", - "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", - "keywords": [ - "uni-ui", - "表单", - "校验", - "表单校验", - "表单验证" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "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": "u" - } - } - } - } -} +{ + "id": "uni-forms", + "displayName": "uni-forms 表单", + "version": "1.3.2", + "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", + "keywords": [ + "uni-ui", + "表单", + "校验", + "表单校验", + "表单验证" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "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-forms/readme.md b/uni_modules/uni-forms/readme.md index e8352620b6f85056593f571568f6cdfb8dc11406..63d5a043ee8c43c48d21de1af4855cbef4e0ce50 100644 --- a/uni_modules/uni-forms/readme.md +++ b/uni_modules/uni-forms/readme.md @@ -19,812 +19,5 @@ uni-app的内置组件已经有了 `
`组件,用于提交表单内容。 另外,``组件下面的各个表单项,可以通过``包裹为不同的分组。同一``下的不同表单项目将聚拢在一起,同其他group保持垂直间距。``仅影响视觉效果。 -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - `resetFields` 方法不会重置原生组件和三方组件的值 -> - 如果配置 `validateTrigger` 属性为 `bind` 且表单域组件使用 `input` 事件触发会耗损部分性能,请谨慎使用 -> - 组件支持 nvue ,需要在 `manifest.json > app-plus` 节点下配置 `"nvueStyleCompiler" : "uni-app"` -> - uni-forms 中不包含其他表单组件,如需使用 uni-easyinput、uni-data-checkbox 等组件,需要自行引入 -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -`uni-forms` 组件通常用来做表单校验和提交。每一个 `uni-forms-item` 是它的一个表单域组件,用来承载表单具体内容,`uni-forms-item` 中可以嵌套 `uni-easyinput`、`uni-data-checkbox` 和 uni-app内置的表单组件 ,不过 uni-app 的内置表单组件需要通过 `binddata` 或者 `uni-forms` 提供的 `setValue` 方法,将内容与 `uni-forms` 关联,才可完成表单的校验与提交(详见后文`表单校验` 部分) - -```html - -``` - -### 对齐方式 - -使用 `label-position` 属性可以设置所有表单域的位置,默认在左侧 - -```html - -``` - -## 表单校验 - -表单校验还可以直接通过 `uniCloud web 控制台` 快速根据 `schema` 自动生成表单维护界面,比如新建页面和编辑页面,自动处理校验规则,更多参考[DB Schema](https://uniapp.dcloud.io/uniCloud/schema) - -### 如何使用 - -1. `uni-forms` 需要通过 `rules` 属性传入约定的校验规则,详细描述下文`校验规则说明`。 -```html - - - ... - -``` - -2. `uni-forms` 需要绑定`modelValue`属性,值为表单的key\value 组成的对象。 -```html - - - ... - -``` - -3. `uni-forms-item` 需要设置 `name` 属性为当前字段名,字段为 `String` 类型而非变量。 -```html - - - - - - - - - -``` - -4. 如果使用`uni-easyinput` 和 `uni-data-checkbox` 等关联组件,只需绑定 v-model,无需其他操作。 -5. 如果使用原生 input、checkbox 或三方组件等,只需要给组件绑定 `binddata` 方法即可触发表单校验,无需绑定事件到 `methods` 中,见下方完整示例。 -6. `binddata('name',$event.detail.value,'form')"` 方法接受三个值, - - 第一个参数传入当前表单组件所在的 name,同当前父组件 `uni-forms-item` 绑定属性 `name` 的值 - - 第二个参数传入需要校验的值,内置组件可以通过 `$event.detail.value` 获取到组件的返回值,自定义组件传入需要校验的值即可 - - 第三个参数传入 `uni-forms` 组件绑定属性 `ref` 的值,通常在多表单的时候需要传入,用来区分表单,如页面中仅有一个 `uni-forms` 可忽略 -7. 如果内置 `binddata` 方法无法满足需求,在当前页面的 `methods` 中复写此方法即可,复写此方法需要调用 `uni-forms` 的 `setValue` 来触发表单校验,见下方 `setValue`方法说明 - -**完整示例** - -```html - - -``` - -```javascript -export default { - data() { - return { - // 表单数据 - formData: { - name: 'LiMing', - email: 'dcloud@email.com' - }, - rules: { - // 对name字段进行必填验证 - name: { - rules: [{ - required: true, - errorMessage: '请输入姓名', - }, - { - minLength: 3, - maxLength: 5, - errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', - } - ] - }, - // 对email字段进行必填验证 - email: { - rules: [{ - format: 'email', - errorMessage: '请输入正确的邮箱地址', - }] - } - } - } - }, - methods: { - /** - * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法 - * @param {String} name 字段名称 - * @param {String} value 表单域的值 - */ - // binddata(name,value){ - // 通过 input 事件设置表单指定 name 的值 - // this.$refs.form.setValue(name, value) - // }, - // 触发提交表单 - submit() { - this.$refs.form.validate().then(res=>{ - console.log('表单数据信息:', res); - }).catch(err =>{ - console.log('表单错误信息:', err); - }) - } - } -} -``` - -> **注意** -> `modelValue` 对象目前有比较严格的格式要求: -> - 尽量不要使用嵌套的数据结构,因为表单域指定的`name`值与 modeValue 的 key 是一一对应的,只有一种情况例外,那就是动态校验表单,见下方`动态校验表单`章节 - - -### 校验规则说明 - -校验规则接受一个 `Object` 类型的值,通过传入不同的规则来表示每个表单域的值该如何校验 - -对象的 `key` 表示当前表单域的字段名,`value` 为具体的校验规则 - -以下为 `value` 所包含的内容: - -|属性名|类型|说明| -|:-:|:-:|:-:| -|rules|Array|校验规则,见下方 `rules 属性说明`| -|validateTrigger| String| 表单校验时机| -|label|String|当前表单域的字段中文名,多用于 `errorMessage` 的显示,可不填| - - -```javascript -rules: { - // 对name字段进行必填验证 - name: { - // name 字段的校验规则 - rules:[ - // 校验 name 不能为空 - { - required: true, - message: '请填写姓名', - }, - // 对name字段进行长度验证 - { - minLength: 3, - maxLength: 5, - message: '{label}长度在 {minLength} 到 {maxLength} 个字符', - } - ], - // 当前表单域的字段中文名,可不填写 - label:'姓名', - validateTrigger:'submit' - } -} - -``` - - -### rules 属性说明 -每一个验证规则中,可以配置多个属性,下面是一些常见规则属性。实际上这里的规范,与uniCloud的[DB Schema](https://uniapp.dcloud.io/uniCloud/schema?id=validator)规范相同。 - -|属性名|类型|默认值|可选值|说明 | -|:-:|:-:|:-:|:-:|:-:| -|required|Boolean|-|-|是否必填,配置此参数不会显示输入框左边的必填星号,如需要,请配置`uni-forms-item`组件的的required为true| -|range|Array|-|-|数组至少要有一个元素,且数组内的每一个元素都是唯一的。 | -|format|String|-|-|内置校验规则,如这些规则无法满足需求,可以使用正则匹配或者自定义规则 | -|pattern|RegExp|-|-|正则表达式,注意事项见下方说明| -|maximum|Number|-|-| 校验最大值(大于)| -|minimum|Number|-|-| 校验最小值(小于) | -|maxLength|Number|-|-| 校验数据最大长度 | -|errorMessage|String|-|-|校验失败提示信息语,可添加属性占位符,当前表格内属性都可用作占位符| -|trigger|String|bind| bind/submit|校验触发时机| -|validateFunction|Function|-|-|自定义校验规则 | - - -**format属性值说明** - -|属性名|说明| -|:-:|:-:| -|string|必须是 string 类型,默认类型| -|number|必须是 number 类型| -|boolean|必须是 boolean 类型| -|array|必须是 array 类型| -|object|必须是 object 类型| -|url|必须是 url 类型| -|email|必须是 email 类型| - - -> **pattern属性说明** -> 在小程序中,json 中不能使用正则对象,如:`/^\S+?@\S+?\.\S+?$/`,使用正则对象会被微信序列化,导致正则失效。 -> 所以建议统一使用字符串的方式来使用正则 ,如`'^\\S+?@\\S+?\\.\\S+?$'` ,需要注意 `\` 需要使用 `\\` 来转译。 -> 如验证邮箱:/^\S+?@\S+?\.\S+?$/ (注意不带引号),或使用 "^\\S+?@\\S+?\\.\\S+?$"(注意带引号需要使用 `\` 转义) - - - -### validateFunction 自定义校验规则使用说明 -`uni-forms` 的 `rules` 基础规则有时候不能满足项目的所有使用场景,这时候可以使用 `validateFunction` 来自定义校验规则 - -`validateFunction` 方法返回四个参数 `validateFunction:function(rule,value,data,callback){}` ,当然返回参数名开发者可以自定义: - - rule : 当前校验字段在 rules 中所对应的校验规则 - - value : 当前校验字段的值 - - data : 所有校验字段的字段和值的对象 - - callback : 校验完成时的回调,一般无需执行callback,返回true(校验通过)或者false(校验失败)即可 ,如果需要显示不同的 `errMessage`,如果校验不通过需要执行 callback('提示错误信息'),如果校验通过,执行callback()即可 - - -> **注意** -> 需要注意,如果需要使用 `validateFunction` 自定义校验规则,则不能采用 `uni-forms` 的 `rules` 属性来配置校验规则,这时候需要通过`ref`,在`onReady`生命周期调用组件的`setRules`方法绑定验证规则 -> 无法通过props传递变量,是因为微信小程序会过滤掉对象中的方法,导致自定义验证规则无效。 -> - - - - - -```html - - -``` - -```javascript -export default { - data() { - return { - formData:{ - - }, - rules: { - hobby: { - rules: [{ - required: true, - errorMessage: '请选择兴趣', - },{ - validateFunction:function(rule,value,data,callback){ - if (value.length < 2) { - callback('请至少勾选两个兴趣爱好') - } - return true - } - }] - } - } - } - }, - onReady() { - // 需要在onReady中设置规则 - this.$refs.form.setRules(this.rules) - }, - methods: { - submit(form) { - this.$refs.form.validate().then(res=>{ - console.log('表单数据信息:', res); - }).catch(err =>{ - console.log('表单错误信息:', err); - }) - } - } -} - -``` - - -### validateFunction 异步校验 - -上面的自定义校验方式为同步校验 ,如果需要异步校验,`validateFunction` 需要返回一个 `Promise` ,校验不通过 执行 `reject(new Error('错误信息'))` 返回对应的错误信息,如果校验通过则直接执行 `resolve()` 即可,在异步校验方法中,不需要使用 `callback` 。 - -```html - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - age: { - rules: [{ - required: true, - errorMessage: '请输入年龄', - },{ - validateFunction: (rule, value, data, callback) => { - // 异步需要返回 Promise 对象 - return new Promise((resolve, reject) => { - setTimeout(() => { - if (value > 10 ) { - // 通过返回 resolve - resolve() - } else { - // 不通过返回 reject(new Error('错误信息')) - reject(new Error('年龄必须大于十岁')) - } - }, 2000) - }) - } - }] - } - } - } - }, - onReady() { - // 需要在onReady中设置规则 - this.$refs.form.setRules(this.rules) - }, - methods: { - /** - * 表单提交 - * @param {Object} event - */ - submit() { - uni.showLoading() - this.$refs.form.validate().then(res => { - uni.hideLoading() - console.log('表单数据信息:', res); - }).catch(err => { - uni.hideLoading() - console.log('表单错误信息:', err); - }) - } - } -} - -``` - - -### 动态表单校验 - -`uni-forms v1.0.44` 开始增加了动态校验表单的相关内容。 - -多用于同一个字段需要添加多次的场景,如需要动态创建多个域名参与检验。 - -1. 在 `formData` 中定义个变量用来接受同一个字段的多个结果。 -```javascript -dynamicFormData: { - email: '', - // domains 字段下会有多个结果 - domains: {} -} -``` - - -2. 使用 `uni-forms-item` 的 `rules` 属性定义单个表单域的校验规则。 -```html - - ... - -``` - -3. `name` 需要动态指定,格式为: `字段[唯一值]` -```html - - ... - -``` - -4. 需要绑定值的组件的 v-model 也需要动态指定,格式为:`数据源.字段[唯一值]` -```html - - - -``` - -**完整示例** - -```html - - - - - - - - - - - - - -``` - -```javascript -export default { - data() { - return { - // 数据源 - dynamicFormData: { - email: '', - domains: {} - }, - // 动态表单数据 - dynamicLists: [], - // 规则 - dynamicRules: { - email: { - rules: [{ - required: true, - errorMessage: '域名不能为空' - }, { - format: 'email', - errorMessage: '域名格式错误' - }] - } - } - } - }, - methods: { - // 新增表单域 - add() { - this.dynamicLists.push({ - label: '域名', - id: Date.now() - }) - }, - // 删除表单域 - del(id) { - let index = this.dynamicLists.findIndex(v => v.id === id) - this.dynamicLists.splice(index, 1) - }, - // 提交 - submit(ref) { - this.$refs[ref].validate((err,value)=>{ - console.log(err,value); - }) - }, - } -} - -// 返回值格式 ,根据自有业务,自行处理数据 -{ - emial:'', - domains:{ - id1:'', - id2:'', - ... - } -} -``` - - -### 表单校验时机说明 - -不管是在规则里还是`uni-forms`、`uni-forms-item`里,都有 `validateTrigger` 属性, `validateTrigger` 属性规定了表单校验时机,当前只有 `bind`、`submit` 两个值域 - -- `bind` : 数据绑定时触发校验,`uni-esayinput` 、`uni-data-checkbox` 组件表现为数据发生变化时。其他内置或三方组件为 `binddata` 事件执行时机 - -```html - - - -``` - -- `submit`: 只有提交表单才会触发表单校验 - - -对于表单校验时机,同时只会有一个 `validateTrigger` 发生作用,它的作用权重为 - -**`规则 > uni-forms-item > uni-forms `** - -- 如果规则里配置 `validateTrigger` ,则优先使用规则里的 `validateTrigger` 属性来决定表单校验时机 -- 如果规则里没有配置 `validateTrigger` ,则优先使用 `uni-forms-item` 的 `validateTrigger` 属性来决定表单校验时机 -- 如果 `uni-forms-item` 组件里没有配置 `validateTrigger` ,则优先使用 `uni-forms` 的 `validateTrigger` 属性来决定表单校验时机 -- 以此类推,如果都没有使用 `validateTrigger` 属性,则会使用 `uni-forms` 的 `validateTrigger` 属性默认值来决定表单校验时机 - - -## API - -### Forms Props - -|属性名|类型|默认值|可选值|说明| -|:-:|:-:|:-:|:-:|:-:| -|value [即将废弃]|Object|-|-| 表单数据| -|modelValue|Object|-|-| 表单数据| -|rules|Object|-|-|表单校验规则| -|validate-trigger|String|submit|bind/submit| 表单校验时机| -|label-position|String|left|top/left|label 位置| -|label-width|String/Number|75|-|label 宽度,单位 px| -|label-align|String|left| left/center/right|label 居中方式| -|err-show-type|String|undertext| undertext/toast/modal|表单错误信息提示方式| -|border|Boolean|false|-|是否显示分格线| - -### Forms Events - -|事件称名|说明| -|:-:|:-:| -|validate|任意表单项被校验后触发,返回表单校验信息| - -### Forms Methods - -|方法称名|说明| -|:-:| :-:| -|submit[即将废弃]| 对整个表单进行校验的方法,会返回一个 promise| -|validate|对整个表单进行校验的方法,会返回一个 promise| -|setValue|设置表单某一项 name 的对应值,通常在 uni-forms-item 和自定表单组件中使用| -|validateField|部分表单进行校验| -|clearValidate|移除表单的校验结果| -|resetFields|重置表单, 需要把 `uni-forms` 的`modelValue`属性改为 `v-model` ,且对内置组件可能不生效| - - - -### validate(keepItem:Array,callback:Function) 方法说明 -`validate` 方法是对整个表单进行校验,方法接受两个参数 - -|参数称名|类型|说明| -|:-:| :-:|:-:| -|keepItem|Array|保留不参与校验的字段| -|callback|Function|校验完成返回函数| - -校验成功后,校验对象只保留指定了`name`的字段(只要 ``uni-forms-item` 绑定了 `name`,哪怕不校验,也会返回),如果需要保留其他字段,则需要 `keepItem` 属性 - -```html - - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - // ... - } - } - }, - onLoad(){ - this.formData.id = 'testId' - }, - methods: { - submit() { - // 在 onLoad 生命周期中,formData添加了一个 id 字段 ,此时这个字段是不参数校验的,所以结果中不返回 - // 在 validate(['id']) 方法中,指定第一个参数 ,即可返回id字段 - this.$refs.form.validate(['id'],(err,formData)=>{ - if(!err){ - console.log('success',formData) - } - }) - } - } -} - -``` - - -`validate` 方法还可以返回一个 `Promise` 对象,如果使用了 `callback` 则`Promise` 返回 `null`,`validate` 方法会优先使用 `callback`。 - -`callback` 方法会返回两个返回值 : -- 第一个返回值为检验结果,如果校验失败,则返回失败信息,如果成功,返回 `null` -- 第二个返回值校验数据 - - -```javascript - -// 使用 callback -// 如果不需要 keepItem 参数 ,则可以省略 -this.$refs.form.validate((err,formData)=>{ - // 如果校验成功 ,err 返回 null - if(!err){ - console.log('success',formData) - return - } - console.log('error',err) -}).then(res=>{ - // res 返回 null -}) - -// 使用 Promise -// 对整个表单进行校验,返回一个 Promise -this.$refs.form.validate().then((res)=>{ - // 成功返回,res 为表单数据 - // 其他逻辑处理 - // ... -}).catch((err)=>{ - // 表单校验验失败,err 为具体错误信息 - // 其他逻辑处理 - // ... -}) - -``` - -### setValue(name:String,value:any) 方法说明 - -`setValue` 方法通常用于内置组件或三方组件返回值的校验,因为`uni-esayinput` 等 uni 开头的组件内置了对 `uni-forms`的支持,所以这些组件返回的值可以直接使用,但是比如像`input` 这些内置组件值的变化,无法及时通知 `uni-forms` ,从而无法正常的校验,这时就需要我们手动将这些值加入到`uni-forms`的校验。 - -`setValue` 方法接受两个参数: -- name: 表单域对应的name -- value: 表单域对应的值 - -```html - - - -``` - -```javascript -export default { - data() { - return { - formData:{ - age:'' - }, - rules: { - // ... - } - } - }, - methods: { - setValue(name,value){ - // 设置表单某项对应得值来触发表单校验 - // 接受两个参数,第一个参数为表单域的 name ,第二个参数为表单域的值 - this.$refs.form.setValue(name,value) - }, - submit() { - this.$refs.form.validate(['id'],(err,formData)=>{ - if(!err){ - console.log('success',formData) - } - }) - } - } -} - -``` - -### 其他方法说明 - -```javascript - -// 部分表单进行校验,接受一个参数,类型为 String 或 Array ,只校验传入 name 表单域的值 -this.$refs.form.validateField(['name', 'email']).then((res)=>{ - // 成功返回,res 为对应表单数据 - // 其他逻辑处理 - // ... -}).catch((err)=>{ - // 表单校验验失败,err 为具体错误信息 - // 其他逻辑处理 - // ... -}) - -// 移除表单校验,接受一个参数,类型为 String 或 Array ,只移除传入 name 表单域的值,如果不传入参数,则移除所有 -this.$refs.form.clearValidate(['name', 'email']) - -``` - - -### FormsItem Props - -|属性名|类型|默认值|可选值 |说明| -|:-:|:-:|:-:|:-:|:-:| -|name|String|-|-|表单域的属性名,在使用校验规则时必填| -|required|Boolean|false|-|label 右边显示红色"*"号,样式显示不会对校验规则产生效果| -|validate-trigger|String|submit|bind/submit|表单校验时机| -|left-icon|String|-|-| label左边的图标,限uni-ui的图标名称| -|icon-color|String|#606266|-| 左边通过icon配置的图标的颜色| -|label|String|-|-| 输入框左边的文字提示| -|label-width|Number|70|-| label的宽度,单位px| -|label-align|String|left|left/center/right|label的文字对齐方式| -|label-position|String|left|top/left|label的文字的位置| -|error-message|String|-|-|显示的错误提示内容,如果为空字符串或者false,则不显示错误信息| - - -### FormsItem Slots -|插槽名|说明| -|:-:| :-:| -|default|默认插槽| -|left(已经失效,请使用label代替)|label插槽,自定义label显示内容| -|label|label插槽,自定义label显示内容| - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/forms/forms](https://hellouniapp.dcloud.net.cn/pages/extUI/forms/forms) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-forms) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-goods-nav/changelog.md b/uni_modules/uni-goods-nav/changelog.md index b0212bbb6032d390ac36afd730c469cff087af91..1fd277621fc87efab827d1117efa39467717aef0 100644 --- a/uni_modules/uni-goods-nav/changelog.md +++ b/uni_modules/uni-goods-nav/changelog.md @@ -1,13 +1,16 @@ -## 1.1.1(2021-08-24) -- 新增 支持国际化 -## 1.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 1.0.5(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.4(2021-02-05) -- 调整为uni_modules目录规范 +## 1.2.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-goods-nav](https://uniapp.dcloud.io/component/uniui/uni-goods-nav) +## 1.1.1(2021-08-24) +- 新增 支持国际化 +## 1.1.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.0.7(2021-05-12) +- 新增 组件示例地址 +## 1.0.6(2021-04-21) +- 优化 添加依赖 uni-icons, 导入后自动下载依赖 +## 1.0.5(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.4(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json index 4494f2a5c21ee4bb41f977eb9720302346e20168..94f18684066d02d1ba2cdb5aa63b15d432c1f739 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "cart", "uni-goods-nav.buttonGroup.addToCart": "add to cart", "uni-goods-nav.buttonGroup.buyNow": "buy now" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js index fa8f0f3734de6effb137592fce6c0f722c048432..d2afd081707d24a8b92a8b1c2a30d8e2f19d89f6 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js @@ -5,4 +5,4 @@ export default { en, 'zh-Hans': zhHans, 'zh-Hant': zhHant -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json index 806913a70603b8171525cec67677454ba756e893..84243b03d826f0743c7ee021dcf5412696c9bc86 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "购物车", "uni-goods-nav.buttonGroup.addToCart": "加入购物车", "uni-goods-nav.buttonGroup.buyNow": "立即购买" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json index e862171d0a0889a7e35409b44567befd3fb45f3b..bfd405e5b2559a72a9b0b6606483411953dd0656 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json @@ -3,4 +3,4 @@ "uni-goods-nav.options.cart": "購物車", "uni-goods-nav.buttonGroup.addToCart": "加入購物車", "uni-goods-nav.buttonGroup.buyNow": "立即購買" -} +} diff --git a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue index e2a6baf233db64f27af688ac355eb00b1c2846f6..cbe1532b9b013a44a941fe2a071108be5ace6ec0 100644 --- a/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue +++ b/uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue @@ -18,7 +18,7 @@ - {{ item.text }} @@ -63,12 +63,12 @@ default () { return [{ text: t("uni-goods-nav.buttonGroup.addToCart"), - backgroundColor: '#ffa200', + backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)', color: '#fff' }, { text: t("uni-goods-nav.buttonGroup.buyNow"), - backgroundColor: '#ff0000', + backgroundColor: 'linear-gradient(90deg, #FE6035, #EF1224)', color: '#fff' } ] @@ -164,7 +164,7 @@ .uni-tab__text { margin-top: 3px; - font-size: $uni-font-size-sm; + font-size: 12px; color: #646566; } @@ -182,7 +182,7 @@ } .uni-tab__cart-button-right-text { - font-size: $uni-font-size-base; + font-size: 14px; color: #fff; } @@ -221,12 +221,4 @@ // width: auto; border-radius: 15px; } - - .uni-tab__color-y { - background-color: #ffa200; - } - - .uni-tab__color-r { - background-color: #ff0000; - } diff --git a/uni_modules/uni-goods-nav/package.json b/uni_modules/uni-goods-nav/package.json index d7d56ee0c151a95d8144272b20037f0bd996132c..b3226dd6353ac81911475da5a21010e34b9b4d81 100644 --- a/uni_modules/uni-goods-nav/package.json +++ b/uni_modules/uni-goods-nav/package.json @@ -1,87 +1,88 @@ -{ - "id": "uni-goods-nav", - "displayName": "uni-goods-nav 商品导航", - "version": "1.1.1", - "description": "商品导航组件主要用于电商类应用底部导航,可自定义加入购物车,购买等操作", - "keywords": [ - "uni-ui", - "uniui", - "商品导航" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { +{ + "id": "uni-goods-nav", + "displayName": "uni-goods-nav 商品导航", + "version": "1.2.0", + "description": "商品导航组件主要用于电商类应用底部导航,可自定义加入购物车,购买等操作", + "keywords": [ + "uni-ui", + "uniui", + "商品导航" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { "dependencies": [ - "uni-icons" - ], - "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": "u" - } - } - } - } -} \ No newline at end of file + "uni-scss", + "uni-icons" + ], + "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-goods-nav/readme.md b/uni_modules/uni-goods-nav/readme.md index 4e47bfda746815456ecb75a35f0ebd6b7f31f127..07df93f55bb4d3e5320cba0f403a58174e1801c2 100644 --- a/uni_modules/uni-goods-nav/readme.md +++ b/uni_modules/uni-goods-nav/readme.md @@ -1,111 +1,10 @@ -### GoodsNav 商品导航 -*已经支持在nvue页面中使用* +## GoodsNav 商品导航 +> **组件名:uni-goods-nav** +> 代码块: `uGoodsNav` -商品加入购物车,立即购买,组件名:`uni-goods-nav`,代码块: uGoodsNav。 +商品加入购物车,立即购买等。 -### 使用方式 - -引用组件 - -```javascript -import uniGoodsNav from '@/components/uni-goods-nav/uni-goods-nav.vue' -export default { - components: {uniGoodsNav} -} -``` - -使用组件 - -```html - -``` - -```javascript -export default { - data () { - return { - options: [{ - icon: 'headphones', - text: '客服' - }, { - icon: 'shop', - text: '店铺', - info: 2, - infoBackgroundColor:'#007aff', - infoColor:"red" - }, { - icon: 'cart', - text: '购物车', - info: 2 - }], - buttonGroup: [{ - text: '加入购物车', - backgroundColor: '#ff0000', - color: '#fff' - }, - { - text: '立即购买', - backgroundColor: '#ffa200', - color: '#fff' - } - ] - } - }, - methods: { - onClick (e) { - uni.showToast({ - title: `点击${e.content.text}`, - icon: 'none' - }) - }, - buttonClick (e) { - console.log(e) - this.options[2].info++ - } - } -} -``` - -### 属性说明 - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|options |Array |- |组件参数 | -|buttonGroup|Array |- |组件按钮组参数 | -|fill |Boolean|false |按钮是否平铺 | - - -**options 参数说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |显示文字 | -|icon |String | |图标,[参考](https://ext.dcloud.net.cn/plugin?id=28) | -|info |Number |0 |右上角数字角标 | -|infoBackgroundColor|String |#ff0000|角标背景色 | -|infoColor |String |#fff |角标前景色 | - -**buttonGroup 参数说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|text |String |- |按钮文字 | -|backgroundColor |String |- |按钮背景色 | -|color |String |- |字体颜色 | - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@click |左侧点击事件 |e = {index,content}| -|@buttonClick |右侧按钮组点击事件 |e = {index,content}| - -### 插件预览地址 - -[https://uniapp.dcloud.io/h5/pages/extUI/goods-nav/goods-nav](https://uniapp.dcloud.io/h5/pages/extUI/goods-nav/goods-nav) - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/goods-nav/goods-nav](https://hellouniapp.dcloud.net.cn/pages/extUI/goods-nav/goods-nav) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-goods-nav) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-grid/changelog.md b/uni_modules/uni-grid/changelog.md index 8fc506d7f63d4483173d7dba2444e84a5cac3132..184941db61b1cdfcf51ff01e2a79237cdce374a6 100644 --- a/uni_modules/uni-grid/changelog.md +++ b/uni_modules/uni-grid/changelog.md @@ -1,5 +1,10 @@ -## 1.3.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.4.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-grid](https://uniapp.dcloud.io/component/uniui/uni-grid) +## 1.3.2(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.3.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.3.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.2.4(2021-05-12) diff --git a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue index c63bbc2ba9e9f1fa5e6cd7921f9e75f265ce752a..ab86a04e76b5c9daf52b85c86f6ad1e5b70327d2 100644 --- a/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue +++ b/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue @@ -94,34 +94,34 @@ .uni-grid-item--border { position: relative; /* #ifdef APP-NVUE */ - border-bottom-color: $uni-border-color; + border-bottom-color: #D2D2D2; border-bottom-style: solid; border-bottom-width: 0.5px; - border-right-color: $uni-border-color; + border-right-color: #D2D2D2; border-right-style: solid; border-right-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ z-index: 0; - border-bottom: 1px $uni-border-color solid; - border-right: 1px $uni-border-color solid; + border-bottom: 1px #D2D2D2 solid; + border-right: 1px #D2D2D2 solid; /* #endif */ } .uni-grid-item--border-top { position: relative; /* #ifdef APP-NVUE */ - border-top-color: $uni-border-color; + border-top-color: #D2D2D2; border-top-style: solid; border-top-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ - border-top: 1px $uni-border-color solid; + border-top: 1px #D2D2D2 solid; z-index: 0; /* #endif */ } .uni-highlight:active { - background-color: $uni-bg-color-hover; + background-color: #f1f1f1; } diff --git a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue index b7cc9a4973f06babfa051cb85e9b4de444036605..71edf41d00d64734e05067a9950d501c55d148a7 100644 --- a/uni_modules/uni-grid/components/uni-grid/uni-grid.vue +++ b/uni_modules/uni-grid/components/uni-grid/uni-grid.vue @@ -39,7 +39,7 @@ // 边框颜色 borderColor: { type: String, - default: '#e5e5e5' + default: '#D2D2D2' }, // 是否正方形显示,默认为 true square: { @@ -130,13 +130,13 @@ .uni-grid--border { position: relative; /* #ifdef APP-NVUE */ - border-left-color: $uni-border-color; + border-left-color: #D2D2D2; border-left-style: solid; border-left-width: 0.5px; /* #endif */ /* #ifndef APP-NVUE */ z-index: 1; - border-left: 1px $uni-border-color solid; + border-left: 1px #D2D2D2 solid; /* #endif */ } diff --git a/uni_modules/uni-grid/package.json b/uni_modules/uni-grid/package.json index 90306f59842ac39934bc6e17d973ca290490257b..c68c9524a4049b068c116b20bb5753defa228fe7 100644 --- a/uni_modules/uni-grid/package.json +++ b/uni_modules/uni-grid/package.json @@ -1,7 +1,7 @@ { "id": "uni-grid", "displayName": "uni-grid 宫格", - "version": "1.3.1", + "version": "1.4.0", "description": "Grid 宫格组件,提供移动端常见的宫格布局,如九宫格。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss","uni-icons"], "encrypt": [], "platforms": { "cloud": { @@ -75,8 +75,12 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } } -} \ No newline at end of file +} diff --git a/uni_modules/uni-grid/readme.md b/uni_modules/uni-grid/readme.md index a748954791c56f14bc6108bffc9f62c99d282c82..0aa44cc13ef465ddef4b714bb2beada21837fae2 100644 --- a/uni_modules/uni-grid/readme.md +++ b/uni_modules/uni-grid/readme.md @@ -7,89 +7,5 @@ 宫格组件。 -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 删除组件自带圆点角标效果,完全交给用户实现,示例有简单角标效果实现 -> - Grid 组件仅在自定义组件模式下支持 -> - column 属性最大值最好不要超过 5 个,如果超过,需要注意内容显示 -> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: `详情 --> 项目配置 --> 启用 component2 编译` -> - 为了避免高度显示错误组件内必须要有内容 - - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - 文本 - - - 文本 - - - 文本 - - - - - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - - 文本 - - -``` - -## API - -### Grid Props - -**uni-grid 属性说明:** - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|column |Number |3 |每列显示个数 | -|borderColor|String |#d0dee5|边框颜色 | -|showBorder |Boolean|true |是否显示边框 | -|square |Boolean|true |是否方形显示 | -|highlight |Boolean|true |点击背景是否高亮 | - -### Grid Events -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@change|点击 grid 触发 |e={detail:{index:0}},index 为当前点击 gird 下标| - - -### GridItem Props - -|属性名|类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|index|Number |- |子组件的唯一标识 ,点击gird会返回当前的标识| - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/grid/grid](https://hellouniapp.dcloud.net.cn/pages/extUI/grid/grid) \ No newline at end of file +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-grid) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-group/changelog.md b/uni_modules/uni-group/changelog.md index 6a36f7dfd096b34e82946b9eb8ae1574b04918b1..2986614a6e553e88ee84028ba5bc5c5c5bb82b6b 100644 --- a/uni_modules/uni-group/changelog.md +++ b/uni_modules/uni-group/changelog.md @@ -1,6 +1,12 @@ -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -- 优化 组件文档 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.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-group](https://uniapp.dcloud.io/component/uniui/uni-group) +## 1.1.7(2021-11-08) +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +- 优化 组件文档 ## 1.0.3(2021-05-12) - 新增 组件示例地址 ## 1.0.2(2021-02-05) diff --git a/uni_modules/uni-group/components/uni-group/uni-group.vue b/uni_modules/uni-group/components/uni-group/uni-group.vue index eaae7f0c0615f9e98bca1f34bc6fb9a8281b8761..367591c3170a01bf9f5a1f1b98f09aad87734686 100644 --- a/uni_modules/uni-group/components/uni-group/uni-group.vue +++ b/uni_modules/uni-group/components/uni-group/uni-group.vue @@ -96,9 +96,9 @@ align-items: center; padding-left: 15px; height: 40px; - background-color: $uni-bg-color-grey; + background-color: #eee; font-weight: normal; - color: $uni-text-color; + color: #666; } .uni-group__content { @@ -112,8 +112,8 @@ } .uni-group__title-text { - font-size: $uni-font-size-base; - color: $uni-text-color; + font-size: 14px; + color: #666; } .distraction { diff --git a/uni_modules/uni-group/package.json b/uni_modules/uni-group/package.json index ec178634a892db382e2c5d80e290dffce916cdfd..8717e84f079f040692de371fcea1b1994e2212ec 100644 --- a/uni_modules/uni-group/package.json +++ b/uni_modules/uni-group/package.json @@ -1,7 +1,7 @@ { "id": "uni-group", "displayName": "uni-group 分组", - "version": "1.1.0", + "version": "1.2.1", "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块", "keywords": [ "uni-ui", @@ -41,7 +41,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -76,6 +76,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-group/readme.md b/uni_modules/uni-group/readme.md index deefb22cd115448fcf7f41e50f01bc8f44c62154..59d70378c5e16810187b6141472bfc1d6d2fdd45 100644 --- a/uni_modules/uni-group/readme.md +++ b/uni_modules/uni-group/readme.md @@ -1,54 +1,9 @@ - - -### Group 分组 - -分组组件可用于将组件分组,添加间隔,以产生明显的区块,组件名:``uni-group``,代码块: uGroup。 - -### 平台差异说明 - -如无特殊说明,则全平台可用 - -### 组件使用注意事项 - -为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 - -- 组件需要依赖 `sass` 插件 ,请自行手动安装 -- 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - - -### 使用方式 - -在 ``template`` 中使用组件 - -```html - - 分组1 的内容 - 分组1 的内容 - - - - 分组2 的内容 - 分组2 的内容 - -``` - -### 属性说明 - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|title|String|-|主标题| -|top|Number|-|分组间隔| -|mode|String|''|模式 ,card 为卡片模式| - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/group/group](https://hellouniapp.dcloud.net.cn/pages/extUI/group/group) \ No newline at end of file + +## Group 分组 +> **组件名:uni-group** +> 代码块: `uGroup` + +分组组件可用于将组件分组,添加间隔,以产生明显的区块。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-group) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-icons/changelog.md b/uni_modules/uni-icons/changelog.md index 3c01efc160aa64547fb95a8ef75d308eef891cfa..64498853cdd91577d9cb5646bf50b307a83d58fe 100644 --- a/uni_modules/uni-icons/changelog.md +++ b/uni_modules/uni-icons/changelog.md @@ -1,3 +1,9 @@ +## 1.3.5(2022-01-24) +- 优化 size 属性可以传入不带单位的字符串数值 +## 1.3.4(2022-01-24) +- 优化 size 支持其他单位 +## 1.3.3(2022-01-17) +- 修复 nvue 有些图标不显示的bug,兼容老版本图标 ## 1.3.2(2021-12-01) - 优化 示例可复制图标名称 ## 1.3.1(2021-11-23) diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js index d18973786f37e0f4193ff9052a398a2bdd464e3a..78899364ed8043d4ac7051a5b6c3821bfd1e802a 100644 --- a/uni_modules/uni-icons/components/uni-icons/icons.js +++ b/uni_modules/uni-icons/components/uni-icons/icons.js @@ -173,6 +173,13 @@ export default { "unicode": "e6bb", "unicode_decimal": 59067 }, + { + "icon_id": "24923353", + "name": "arrowthinright", + "font_class": "arrowthinright", + "unicode": "e6bb", + "unicode_decimal": 59067 + }, { "icon_id": "24923354", "name": "arrowthinleft", @@ -180,6 +187,13 @@ export default { "unicode": "e6bc", "unicode_decimal": 59068 }, + { + "icon_id": "24923354", + "name": "arrowthinleft", + "font_class": "arrowthinleft", + "unicode": "e6bc", + "unicode_decimal": 59068 + }, { "icon_id": "24923355", "name": "arrowthinup", @@ -187,12 +201,25 @@ export default { "unicode": "e6bd", "unicode_decimal": 59069 }, + { + "icon_id": "24923355", + "name": "arrowthinup", + "font_class": "arrowthinup", + "unicode": "e6bd", + "unicode_decimal": 59069 + }, { "icon_id": "24923356", "name": "arrowthindown", "font_class": "arrow-down", "unicode": "e6be", "unicode_decimal": 59070 + },{ + "icon_id": "24923356", + "name": "arrowthindown", + "font_class": "arrowthindown", + "unicode": "e6be", + "unicode_decimal": 59070 }, { "icon_id": "24923349", @@ -200,6 +227,12 @@ export default { "font_class": "bottom", "unicode": "e6b8", "unicode_decimal": 59064 + },{ + "icon_id": "24923349", + "name": "arrowdown", + "font_class": "arrowdown", + "unicode": "e6b8", + "unicode_decimal": 59064 }, { "icon_id": "24923346", @@ -208,6 +241,13 @@ export default { "unicode": "e6b5", "unicode_decimal": 59061 }, + { + "icon_id": "24923346", + "name": "arrowright", + "font_class": "arrowright", + "unicode": "e6b5", + "unicode_decimal": 59061 + }, { "icon_id": "24923347", "name": "arrowup", @@ -215,6 +255,13 @@ export default { "unicode": "e6b6", "unicode_decimal": 59062 }, + { + "icon_id": "24923347", + "name": "arrowup", + "font_class": "arrowup", + "unicode": "e6b6", + "unicode_decimal": 59062 + }, { "icon_id": "24923348", "name": "arrowleft", @@ -222,6 +269,13 @@ export default { "unicode": "e6b7", "unicode_decimal": 59063 }, + { + "icon_id": "24923348", + "name": "arrowleft", + "font_class": "arrowleft", + "unicode": "e6b7", + "unicode_decimal": 59063 + }, { "icon_id": "24923334", "name": "eye", diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue index a9f271d7ff1297e6aa697766f42d6b6f645293da..a87f68e428cd685f8e2235754b208014966d2ed3 100644 --- a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue +++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue @@ -1,14 +1,18 @@ - - + + + + + diff --git a/uni_modules/uni-link/package.json b/uni_modules/uni-link/package.json index 96f23445023e0ae325075658bf9f9c91c1fbab69..3e994711677850872dbb05dbb5892450ae71b1b2 100644 --- a/uni_modules/uni-link/package.json +++ b/uni_modules/uni-link/package.json @@ -1,83 +1,87 @@ -{ - "id": "uni-link", - "displayName": "uni-link 超链接", - "version": "0.0.6", - "description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打", - "keywords": [ - "uni-ui", - "uniui", - "link", - "超链接", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "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" - }, - "快应用": { - "华为": "y", - "联盟": "y" - } - } - } - } +{ + "id": "uni-link", + "displayName": "uni-link 超链接", + "version": "1.0.0", + "description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打", + "keywords": [ + "uni-ui", + "uniui", + "link", + "超链接", + "" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["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" + }, + "快应用": { + "华为": "y", + "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-link/readme.md b/uni_modules/uni-link/readme.md index 0735374c17ef048d6eb466a70545ad299adf42e9..d40fdcadcbead3eb1e0d945bb1958a377d15c211 100644 --- a/uni_modules/uni-link/readme.md +++ b/uni_modules/uni-link/readme.md @@ -1,48 +1,11 @@ - - -## Link 链接 -> **组件名:uni-link** -> 代码块: `uLink` - - -uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - -``` - -## API - -### Link Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|href |String |- |链接地址 | -|text |String |- |显示文字 | -|download |String |- |H5平台下载文件名 | -|showUnderLine|Boolean|true |是否显示下划线 | -|copyTips |String |已自动复制网址,请在手机浏览器里粘贴该网址 |在小程序端复制链接时的提示语 | -|color |String |#999999 |链接文字颜色 | -|fontSize |String |14 |链接文字大小,单位px | - - -### Link Slots - -|名称|说明| -|:-:|:-:| -|default|自定义内容,回覆盖原有的内容显示| - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/link/link](https://hellouniapp.dcloud.net.cn/pages/extUI/link/link) \ No newline at end of file + + +## Link 链接 +> **组件名:uni-link** +> 代码块: `uLink` + + +uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-link) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-list/changelog.md b/uni_modules/uni-list/changelog.md index 713e2698890b9d0778b54f57d59a68bb7bc9c31a..b86237ea334ae2de12a3902c189c15840fe84d8b 100644 --- a/uni_modules/uni-list/changelog.md +++ b/uni_modules/uni-list/changelog.md @@ -1,5 +1,8 @@ -## 1.1.3(2021-08-30) -- 修复 在vue3中to属性在发行应用的时候报错的bug +## 1.2.0(2021-11-23) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-list](https://uniapp.dcloud.io/component/uniui/uni-list) +## 1.1.3(2021-08-30) +- 修复 在vue3中to属性在发行应用的时候报错的bug ## 1.1.2(2021-07-30) - 优化 vue3下事件警告的问题 ## 1.1.1(2021-07-21) diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue index 9f8796f821dd17457e567ee2164f67b0bf46c4c6..a56c8be7b28c782bd44d5a3621d345b620c5121b 100644 --- a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue @@ -217,7 +217,11 @@ }; - diff --git "a/uni_modules/uni-list/components/uni-list/uni-list - \345\211\257\346\234\254.vue" "b/uni_modules/uni-list/components/uni-list/uni-list - \345\211\257\346\234\254.vue" new file mode 100644 index 0000000000000000000000000000000000000000..8a46cfc283ca67bfbbfa0be9bcab89557e03bdba --- /dev/null +++ "b/uni_modules/uni-list/components/uni-list/uni-list - \345\211\257\346\234\254.vue" @@ -0,0 +1,106 @@ + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue index 389178b2b09e45e936e20b7f3aea68b35f6ca5f9..a5bc80fab779d04d5470de230c80eafee476accf 100644 --- a/uni_modules/uni-list/components/uni-list/uni-list.vue +++ b/uni_modules/uni-list/components/uni-list/uni-list.vue @@ -54,7 +54,9 @@ export default { } }; - diff --git a/uni_modules/uni-load-more/package.json b/uni_modules/uni-load-more/package.json index 062ee5deb222929b361aecc31e2dc866ad659e77..2fa6f040a8952a8246f9dd9a875f6b95e21996f6 100644 --- a/uni_modules/uni-load-more/package.json +++ b/uni_modules/uni-load-more/package.json @@ -1,7 +1,7 @@ { "id": "uni-load-more", "displayName": "uni-load-more 加载更多", - "version": "1.2.1", + "version": "1.3.3", "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -78,7 +78,7 @@ }, "Vue": { "vue2": "y", - "vue3": "u" + "vue3": "y" } } } diff --git a/uni_modules/uni-load-more/readme.md b/uni_modules/uni-load-more/readme.md index b781fafd5accab29b9b7cbfe8dfec66618e3594a..54dc1fad29ca3906f3498530878791679e63a7bf 100644 --- a/uni_modules/uni-load-more/readme.md +++ b/uni_modules/uni-load-more/readme.md @@ -7,64 +7,8 @@ 用于列表中,做滚动加载使用,展示 loading 的各种状态。 -### 安装方式 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) -### 使用方式 - -在 ``template`` 中使用组件 - -```html - -``` - -## API - -### LoadMore Props - -|属性名 |类型 | 可选值 |默认值 |说明 | -|:-: |:-: |:-: |:-: |:-: | -|iconSize |Number |- |24 |指定图标大小 | -|status |String |more/loading/noMore |more |loading 的状态 | -|showIcon |Boolean|- |true |是否显示 loading 图标 | -|iconType |String |snow/circle/auto |auto |指定图标样式| -|color |String |- |#777777 |图标和文字颜色 | -|contentText|Object|- |{contentdown: "上拉显示更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"}|各状态文字说明 | - - -#### Status Options -|参数名称 |说明 | -|:-: |:-: | -|more |loading前 | -|loading|loading前中 | -|more |没有更多数据 | - -#### IconType Options -|参数名称 |说明 | -|:-: |:-: | -|snow |ios雪花加载样式 | -|circle |安卓环形加载样式 | -|auto |根据平台自动选择加载样式 | - - - - -> **说明** -> `iconType`为`snow`时,在`APP-NVUE`平台不可设置大小,在非`APP-NVUE`平台不可设置颜色 - - - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|clickLoadMore |点击加载更多时触发 |e.detail={status:'loading'}| - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more](https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more) \ No newline at end of file diff --git a/uni_modules/uni-nav-bar/changelog.md b/uni_modules/uni-nav-bar/changelog.md index 70b3c488026ca64c47a6d00000fa3d0d82fdcdee..fbacca4ba091f83acc7b463f7dc2e853930323ee 100644 --- a/uni_modules/uni-nav-bar/changelog.md +++ b/uni_modules/uni-nav-bar/changelog.md @@ -1,19 +1,37 @@ +## 1.3.4(2022-01-24) +- 更新 组件示例 +## 1.3.3(2022-01-24) +- 新增 left-width/right-width属性 ,可修改左右两侧的宽度 +## 1.3.2(2022-01-18) +- 修复 在vue下,标题不垂直居中的bug +## 1.3.1(2022-01-18) +- 修复 height 属性类型错误 +## 1.3.0(2022-01-18) +- 新增 height 属性,可修改组件高度 +- 新增 dark 属性可可开启暗黑模式 +- 优化 标题字数过多显示省略号 +- 优化 插槽,插入内容可完全覆盖 +## 1.2.1(2022-01-10) +- 修复 color 属性不生效的bug +## 1.2.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-nav-bar](https://uniapp.dcloud.io/component/uniui/uni-nav-bar) ## 1.1.0(2021-07-30) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.11(2021-05-12) -- 新增 组件示例地址 -## 1.0.10(2021-04-30) -- 修复 在nvue下fixed为true,宽度不能撑满的Bug -## 1.0.9(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 1.0.8(2021-04-14) -- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug - -## 1.0.7(2021-02-25) -- 修复 easycom 下,找不到 uni-status-bar 的bug - -## 1.0.6(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.5(2021-02-05) -- 调整为uni_modules目录规范 +## 1.0.11(2021-05-12) +- 新增 组件示例地址 +## 1.0.10(2021-04-30) +- 修复 在nvue下fixed为true,宽度不能撑满的Bug +## 1.0.9(2021-04-21) +- 优化 添加依赖 uni-icons, 导入后自动下载依赖 +## 1.0.8(2021-04-14) +- uni-ui 修复 uni-nav-bar 当 fixed 属性为 true 时铺不满屏幕的 bug + +## 1.0.7(2021-02-25) +- 修复 easycom 下,找不到 uni-status-bar 的bug + +## 1.0.6(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.5(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue index 0df773fecb496747b7996d60362f98405fa8194a..3346a8613fecaf62db36d5f90ba151f72a305056 100644 --- a/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue +++ b/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue @@ -1,52 +1,59 @@ - + diff --git a/uni_modules/uni-nav-bar/package.json b/uni_modules/uni-nav-bar/package.json index caf0ed4b12e8d0a9b3ecd984f347d9a05a40700a..e1473ca11fbe97bf1fc012f7c963c1308c3430d4 100644 --- a/uni_modules/uni-nav-bar/package.json +++ b/uni_modules/uni-nav-bar/package.json @@ -1,84 +1,89 @@ -{ - "id": "uni-nav-bar", - "displayName": "uni-nav-bar 自定义导航栏", - "version": "1.1.0", - "description": "自定义导航栏组件,主要用于头部导航。", - "keywords": [ - "uni-ui", - "导航", - "导航栏", - "自定义导航栏" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons" - ], - "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" - } - } - } - } +{ + "id": "uni-nav-bar", + "displayName": "uni-nav-bar 自定义导航栏", + "version": "1.3.4", + "description": "自定义导航栏组件,主要用于头部导航。", + "keywords": [ + "uni-ui", + "导航", + "导航栏", + "自定义导航栏" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "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" + } + } + } + } } \ No newline at end of file diff --git a/uni_modules/uni-nav-bar/readme.md b/uni_modules/uni-nav-bar/readme.md index fa34c8e6357b1d4ef1e103e037c617a6cb895a8a..3934b3277583a4a8073d2b42a367d237f748157a 100644 --- a/uni_modules/uni-nav-bar/readme.md +++ b/uni_modules/uni-nav-bar/readme.md @@ -1,71 +1,15 @@ -### NavBar 导航栏 -*已经支持在nvue页面中使用* +## NavBar 导航栏 +> **组件名:uni-nav-bar** +> 代码块: `uNavBar` -导航栏组件,主要用于头部导航,组件名:``uni-nav-bar``,代码块: uNavBar。 +导航栏组件,主要用于头部导航。 -### 使用方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-nav-bar) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -在 ``script`` 中引用组件 -```javascript -import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue' -export default { - components: {uniNavBar} -} -``` -在 ``template`` 中使用组件 -```html - -``` -### 属性说明 - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|title |String |- |标题文字 | -|leftText |String |- |左侧按钮文本 | -|rightText |String |- |右侧按钮文本 | -|leftIcon |String |- |左侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性) | -|rightIcon |String |- |右侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性) | -|color |String |#000000|图标和文字颜色 | -|backgroundColor |String |#FFFFFF|导航栏背景颜色 | -|fixed |Boolean|false |是否固定顶部 | -|statusBar |Boolean|false |是否包含状态栏 | -|shadow |Boolean|false |导航栏下是否有阴影 | - -### 插槽说明 - -开发者使用 NavBar 时,支持向 NavBar 里插入不同内容,以达到自定义的目的。 - -|slot名 |说明 | -|:-: |:-: | -|left |向导航栏左侧插入 | -|right |向导航栏右侧插入 | -|default|向导航栏中间插入 | - -```html - - 标题栏 - left - right - -``` - -### 事件说明 - -|事件名 |说明 |返回值 | -|:-: |:-: |:-: | -|@clickLeft |左侧按钮点击时触发 |- | -|@clickRight |右侧按钮点击时触发 |- | - -### 插件预览地址 - -[https://uniapp.dcloud.io/h5/pages/extUI/nav-bar/nav-bar](https://uniapp.dcloud.io/h5/pages/extUI/nav-bar/nav-bar) - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/nav-bar/nav-bar](https://hellouniapp.dcloud.net.cn/pages/extUI/nav-bar/nav-bar) \ No newline at end of file diff --git a/uni_modules/uni-notice-bar/changelog.md b/uni_modules/uni-notice-bar/changelog.md index 37d7319e1f7a1392f2b1fdbdabede28e3dca51b4..b5581226acb2e2a168189f1dc1b6aa587768c88d 100644 --- a/uni_modules/uni-notice-bar/changelog.md +++ b/uni_modules/uni-notice-bar/changelog.md @@ -1,5 +1,10 @@ -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.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-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) +## 1.1.1(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.9(2021-05-12) - 新增 组件示例地址 ## 1.0.8(2021-04-21) diff --git a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue index 914ebe2c6d0d6fe02cd121938badb3c842cc195e..0a50ce2578c7b625cc5bd0971589bedd1b0715d0 100644 --- a/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue +++ b/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue @@ -1,28 +1,24 @@ @@ -31,31 +27,31 @@ // #ifdef APP-NVUE const dom = weex.requireModule('dom'); const animation = weex.requireModule('animation'); - // #endif - - /** - * NoticeBar 自定义导航栏 - * @description 通告栏组件 - * @tutorial https://ext.dcloud.net.cn/plugin?id=30 - * @property {Number} speed 文字滚动的速度,默认100px/秒 - * @property {String} text 显示文字 - * @property {String} backgroundColor 背景颜色 - * @property {String} color 文字颜色 - * @property {String} moreColor 查看更多文字的颜色 - * @property {String} moreText 设置“查看更多”的文本 - * @property {Boolean} single = [true|false] 是否单行 - * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行 - * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标 - * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮 - * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行 - * @event {Function} click 点击 NoticeBar 触发事件 - * @event {Function} close 关闭 NoticeBar 触发事件 - * @event {Function} getmore 点击”查看更多“时触发事件 - */ + // #endif + + /** + * NoticeBar 自定义导航栏 + * @description 通告栏组件 + * @tutorial https://ext.dcloud.net.cn/plugin?id=30 + * @property {Number} speed 文字滚动的速度,默认100px/秒 + * @property {String} text 显示文字 + * @property {String} backgroundColor 背景颜色 + * @property {String} color 文字颜色 + * @property {String} moreColor 查看更多文字的颜色 + * @property {String} moreText 设置“查看更多”的文本 + * @property {Boolean} single = [true|false] 是否单行 + * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行 + * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标 + * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮 + * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行 + * @event {Function} click 点击 NoticeBar 触发事件 + * @event {Function} close 关闭 NoticeBar 触发事件 + * @event {Function} getmore 点击”查看更多“时触发事件 + */ export default { name: 'UniNoticeBar', - emits:['click','getmore','close'], + emits: ['click', 'getmore', 'close'], props: { text: { type: String, @@ -67,7 +63,7 @@ }, backgroundColor: { type: String, - default: '#fffbe8' + default: '#FFF9EA' }, speed: { // 默认1s滚动100px @@ -76,11 +72,11 @@ }, color: { type: String, - default: '#de8c17' + default: '#FF9A43' }, moreColor: { type: String, - default: '#999999' + default: '#FF9A43' }, single: { // 是否单行 @@ -132,10 +128,10 @@ var pages = getCurrentPages(); var page = pages[pages.length - 1]; var currentWebview = page.$getAppWebview(); - currentWebview.addEventListener('hide',()=>{ + currentWebview.addEventListener('hide', () => { this.webviewHide = true }) - currentWebview.addEventListener('show',()=>{ + currentWebview.addEventListener('show', () => { this.webviewHide = false }) // #endif @@ -156,9 +152,9 @@ boxWidth = 0, textWidth = 0; let textQuery = new Promise((resolve, reject) => { - uni.createSelectorQuery() + uni.createSelectorQuery() // #ifndef MP-ALIPAY - .in(this) + .in(this) // #endif .select(`#${this.elId}`) .boundingClientRect() @@ -168,9 +164,9 @@ }) }) let boxQuery = new Promise((resolve, reject) => { - uni.createSelectorQuery() + uni.createSelectorQuery() // #ifndef MP-ALIPAY - .in(this) + .in(this) // #endif .select(`#${this.elIdBox}`) .boundingClientRect() @@ -267,7 +263,6 @@ + diff --git a/uni_modules/uni-notice-bar/package.json b/uni_modules/uni-notice-bar/package.json index e11a41793fd9944fc36873d338dfafc9c352ed3f..37c22302cad869171c45fa5881263953e2d6aa8b 100644 --- a/uni_modules/uni-notice-bar/package.json +++ b/uni_modules/uni-notice-bar/package.json @@ -1,7 +1,7 @@ { "id": "uni-notice-bar", "displayName": "uni-notice-bar 通告栏", - "version": "1.1.0", + "version": "1.2.0", "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告", "keywords": [ "uni-ui", @@ -41,7 +41,8 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [ + "dependencies": [ + "uni-scss", "uni-icons" ], "encrypt": [], @@ -78,6 +79,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-notice-bar/readme.md b/uni_modules/uni-notice-bar/readme.md index f65c5788b4d88ac33a0b887ad26b8e7caaa2a754..fb2ede244adc00c5f777b9f6580e7c0c7729252e 100644 --- a/uni_modules/uni-notice-bar/readme.md +++ b/uni_modules/uni-notice-bar/readme.md @@ -7,65 +7,7 @@ 通告栏组件 。 -### 安装方式 +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - - - - - - - - - - - - -``` - -> **注意** -> 如果需要异步获取内容后展示需要使用`v-if`进行控制,`` - - -## NoticeBar API - -### NoticeBar Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|speed |Number |100 |文字滚动的速度,默认100px/秒 | -|text |String |- |显示文字 | -|background-color |String |#fffbe8|背景颜色 | -|color |String |#de8c17|文字颜色 | -|moreColor |String |#999999|查看更多文字的颜色 | -|moreText |String |- |设置“查看更多”的文本 | -|single |Boolean|false |是否单行 | -|scrollable |Boolean|false |是否滚动,为true时,NoticeBar为单行 | -|showIcon |Boolean|false |是否显示左侧喇叭图标 | -|showClose |Boolean|false |是否显示左侧关闭按钮 | -|showGetMore |Boolean|false |是否显示右侧查看更多图标,为true时,NoticeBar为单行| - -### NoticeBar Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|@click |点击 NoticeBar 触发事件 |- | -|@close |关闭 NoticeBar 触发事件 |- | -|@getmore |点击”查看更多“时触发事件 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/notice-bar/notice-bar](https://hellouniapp.dcloud.net.cn/pages/extUI/notice-bar/notice-bar) \ No newline at end of file diff --git a/uni_modules/uni-number-box/changelog.md b/uni_modules/uni-number-box/changelog.md index 1b73c791692966abf8bba034bb7b6b7cdc93e633..82b8656f0b07014636ebbcde6bed0ad07c5b2089 100644 --- a/uni_modules/uni-number-box/changelog.md +++ b/uni_modules/uni-number-box/changelog.md @@ -1,5 +1,12 @@ -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.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-number-box](https://uniapp.dcloud.io/component/uniui/uni-number-box) +## 1.1.2(2021-11-09) +- 新增 提供组件设计资源,组件样式调整 +## 1.1.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.1.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) diff --git a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue index aee1742d8b532d6f5242deeb3a99b551113761b6..738fe3b7fdb1c8838ef365eb9294222f0393de53 100644 --- a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue +++ b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue @@ -1,11 +1,12 @@ @@ -18,19 +19,23 @@ * @property {Number} min 最小值 * @property {Number} max 最大值 * @property {Number} step 每次点击改变的间隔大小 + * @property {String} background 背景色 + * @property {String} color 字体颜色(前景色) * @property {Boolean} disabled = [true|false] 是否为禁用状态 * @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value + * @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象 + * @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象 */ export default { name: "UniNumberBox", - emits:['change','input','update:modelValue','blur','focus'], + emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'], props: { value: { type: [Number, String], default: 1 }, - modelValue:{ + modelValue: { type: [Number, String], default: 1 }, @@ -45,6 +50,14 @@ step: { type: Number, default: 1 + }, + background: { + type: String, + default: '#f5f5f5' + }, + color: { + type: String, + default: '#333' }, disabled: { type: Boolean, @@ -60,15 +73,15 @@ value(val) { this.inputValue = +val; }, - modelValue(val){ + modelValue(val) { this.inputValue = +val; - } + } }, created() { - if(this.value === 1){ + if (this.value === 1) { this.inputValue = +this.modelValue; } - if(this.modelValue === 1){ + if (this.modelValue === 1) { this.inputValue = +this.value; } }, @@ -141,91 +154,67 @@ }; + diff --git a/uni_modules/uni-number-box/package.json b/uni_modules/uni-number-box/package.json index 940a29574b7a0dbe195036d64bb950e9c97f0360..e774c3f811a0909215c8ddd87a5ca047de2e2a78 100644 --- a/uni_modules/uni-number-box/package.json +++ b/uni_modules/uni-number-box/package.json @@ -1,7 +1,7 @@ { "id": "uni-number-box", "displayName": "uni-number-box 数字输入框", - "version": "1.1.1", + "version": "1.2.1", "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。", "keywords": [ "uni-ui", @@ -39,7 +39,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": [], + "dependencies": ["uni-scss"], "encrypt": [], "platforms": { "cloud": { @@ -74,6 +74,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-number-box/readme.md b/uni_modules/uni-number-box/readme.md index 9c951e4840d8caa16fde972bdf4fd61151672fa3..1037200ce572d64a8bb0cb4d2de4576da443e394 100644 --- a/uni_modules/uni-number-box/readme.md +++ b/uni_modules/uni-number-box/readme.md @@ -1,50 +1,13 @@ - - -## NumberBox 数字输入框 -> **组件名:uni-number-box** -> 代码块: `uNumberBox` - - -带加减按钮的数字输入框。 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - - - -``` - -## API - -### NumberBox Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|value/v-model|Number |0 |输入框当前值 | -|min |Number |0 |最小值 | -|max |Number |100 |最大值 | -|step |Number |1 |每次点击改变的间隔大小 | -|disabled |Boolean|false |是否为禁用状态 | - -### NumberBox Events - -|事件名称 |说明 |返回值 | -|:-: |:-: |:-: | -|change |输入框值改变时触发的事件,参数为输入框当前的 value |- | -|focus |输入框聚焦时触发的事件,参数为 event 对象 |- | -|blur |输入框失焦时触发的事件,参数为 event 对象 |- | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/number-box/number-box](https://hellouniapp.dcloud.net.cn/pages/extUI/number-box/number-box) \ No newline at end of file + + +## NumberBox 数字输入框 +> **组件名:uni-number-box** +> 代码块: `uNumberBox` + + +带加减按钮的数字输入框。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-number-box) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + diff --git a/uni_modules/uni-pagination/changelog.md b/uni_modules/uni-pagination/changelog.md index 9c4fde2f2bef380063ee30ede424af8e34317175..5459dde48126a7cddcfa9cbdbf778c98a7af30a4 100644 --- a/uni_modules/uni-pagination/changelog.md +++ b/uni_modules/uni-pagination/changelog.md @@ -1,5 +1,14 @@ -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.2.1(2021-11-22) +- 修复 vue3中某些scss变量无法找到的问题 +## 1.2.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-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination) +## 1.1.2(2021-10-08) +- 修复 current 、value 属性未监听,导致高亮样式失效的 bug +## 1.1.1(2021-08-20) +- 新增 支持国际化 +## 1.1.0(2021-07-30) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.0.7(2021-05-12) - 新增 组件示例地址 ## 1.0.6(2021-04-12) diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json new file mode 100644 index 0000000000000000000000000000000000000000..1479581d4b47914103013ad34f66bd71021b81ee --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "prev", + "uni-pagination.nextText": "next" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json new file mode 100644 index 0000000000000000000000000000000000000000..7fd8d9df23de9719b3002b49b3189ac3e73f3852 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "anterior", + "uni-pagination.nextText": "próxima" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json new file mode 100644 index 0000000000000000000000000000000000000000..99e80239a9fa8e358fba57b6c74ef934bf871501 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "précédente", + "uni-pagination.nextText": "suivante" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js b/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js new file mode 100644 index 0000000000000000000000000000000000000000..01986f1b4b6d722c2955685c62e22166c1c79dd9 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js @@ -0,0 +1,12 @@ +import en from './en.json' +import es from './es.json' +import fr from './fr.json' +import zhHans from './zh-Hans.json' +import zhHant from './zh-Hant.json' +export default { + en, + es, + fr, + 'zh-Hans': zhHans, + 'zh-Hant': zhHant +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json new file mode 100644 index 0000000000000000000000000000000000000000..448daae50187f3b64099583cd118e9fc04f2e342 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "上一页", + "uni-pagination.nextText": "下一页" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json new file mode 100644 index 0000000000000000000000000000000000000000..39c9137903d948ea4a9c14a48d792b79ceef7d41 --- /dev/null +++ b/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json @@ -0,0 +1,4 @@ +{ + "uni-pagination.prevText": "上一頁", + "uni-pagination.nextText": "下一頁" +} diff --git a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue index 4f07c0eb359076805620022a05061c7452ee19a9..32fd4147a899f42188624d1d0c3fe9e64b9054ca 100644 --- a/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue +++ b/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue @@ -1,404 +1,409 @@ - diff --git a/uni_modules/uni-pagination/package.json b/uni_modules/uni-pagination/package.json index b0e9501aa473e26a51e3e9c50d9f271338da5a2e..c24a2e86b0391e5364360ace06f5763e1fc58bfd 100644 --- a/uni_modules/uni-pagination/package.json +++ b/uni_modules/uni-pagination/package.json @@ -1,7 +1,7 @@ { "id": "uni-pagination", "displayName": "uni-pagination 分页器", - "version": "1.1.0", + "version": "1.2.1", "description": "Pagination 分页器组件,用于展示页码、请求数据等。", "keywords": [ "uni-ui", @@ -40,7 +40,7 @@ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" }, "uni_modules": { - "dependencies": ["uni-icons"], + "dependencies": ["uni-scss","uni-icons"], "encrypt": [], "platforms": { "cloud": { @@ -75,6 +75,10 @@ "快应用": { "华为": "u", "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" } } } diff --git a/uni_modules/uni-pagination/readme.md b/uni_modules/uni-pagination/readme.md index c8e47e3ebd4841a2fea259839349c647536c630c..bbd239b58e275c22218578a25ec42cc306989561 100644 --- a/uni_modules/uni-pagination/readme.md +++ b/uni_modules/uni-pagination/readme.md @@ -1,48 +1,13 @@ - - -## Pagination 分页器 -> **组件名:uni-pagination** -> 代码块: `uPagination` - - -分页器组件,用于展示页码、请求数据等。 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - -``` - -## API - -### Pagination Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|prevText |String |上一页 |左侧按钮文字 | -|nextText |String |下一页 |右侧按钮文字 | -|current |Number |1 |当前页 | -|total |Number |0 |数据总量 | -|pageSize |Number |10 |每页数据量 | -|showIcon |Boolean|false |是否以 icon 形式展示按钮 | - - -### Pagination Events - -|事件称名 |说明 |返回值 | -|:-: |:-: |:-: | -|@change|点击页码按钮时触发 |e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个 | - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/pagination/pagination](https://hellouniapp.dcloud.net.cn/pages/extUI/pagination/pagination) \ No newline at end of file + + +## Pagination 分页器 +> **组件名:uni-pagination** +> 代码块: `uPagination` + + +分页器组件,用于展示页码、请求数据等。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + diff --git a/uni_modules/uni-popup/changelog.md b/uni_modules/uni-popup/changelog.md index a5d6a798e808aeec2251926d012e6ff9f13aeffb..6b1c03b46ab02535b9ce9bbaac7ea4c70bceb6b2 100644 --- a/uni_modules/uni-popup/changelog.md +++ b/uni_modules/uni-popup/changelog.md @@ -1,44 +1,54 @@ +## 1.7.6(2022-02-14) +- 修复 safeArea 属性不能设置为false的bug +## 1.7.5(2022-01-19) +- 修复 isMaskClick 失效的bug +## 1.7.4(2022-01-19) +- 新增 cancelText \ confirmText 属性 ,可自定义文本 +- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 +- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 +## 1.7.3(2022-01-13) +- 修复 设置 safeArea 属性不生效的bug ## 1.7.2(2021-11-26) - 优化 组件示例 ## 1.7.1(2021-11-26) - 修复 vuedoc 文字错误 -## 1.7.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-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) -## 1.6.2(2021-08-24) -- 新增 支持国际化 -## 1.6.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.6.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.5.0(2021-06-23) -- 新增 mask-click 遮罩层点击事件 -## 1.4.5(2021-06-22) -- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.4(2021-06-18) -- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.3(2021-06-08) -- 修复 错误的 watch 字段 -- 修复 safeArea 属性不生效的问题 -- 修复 点击内容,再点击遮罩无法关闭的Bug -## 1.4.2(2021-05-12) -- 新增 组件示例地址 -## 1.4.1(2021-04-29) -- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 -## 1.4.0 (2021-04-29) -- 新增 type 属性的 left\right 值,支持左右弹出 -- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 -- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 -- 新增 safeArea 属性,是否适配底部安全区 -- 修复 App\h5\微信小程序底部安全区占位不对的Bug -- 修复 App 端弹出等待的Bug -- 优化 提升低配设备性能,优化动画卡顿问题 -- 优化 更简单的组件自定义方式 -## 1.2.9(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.2.8(2021-02-05) -- 调整为uni_modules目录规范 -## 1.2.7(2021-02-05) -- 调整为uni_modules目录规范 -- 新增 支持 PC 端 -- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 +## 1.7.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-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) +## 1.6.2(2021-08-24) +- 新增 支持国际化 +## 1.6.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.6.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.5.0(2021-06-23) +- 新增 mask-click 遮罩层点击事件 +## 1.4.5(2021-06-22) +- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.4(2021-06-18) +- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.3(2021-06-08) +- 修复 错误的 watch 字段 +- 修复 safeArea 属性不生效的问题 +- 修复 点击内容,再点击遮罩无法关闭的Bug +## 1.4.2(2021-05-12) +- 新增 组件示例地址 +## 1.4.1(2021-04-29) +- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 +## 1.4.0 (2021-04-29) +- 新增 type 属性的 left\right 值,支持左右弹出 +- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 +- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 +- 新增 safeArea 属性,是否适配底部安全区 +- 修复 App\h5\微信小程序底部安全区占位不对的Bug +- 修复 App 端弹出等待的Bug +- 优化 提升低配设备性能,优化动画卡顿问题 +- 优化 更简单的组件自定义方式 +## 1.2.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.2.8(2021-02-05) +- 调整为uni_modules目录规范 +## 1.2.7(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持 PC 端 +- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue index aeeb3efdcd69883c5ee73efc57660855897eb49a..c20df4a8e923d48804e7935af39baeb67e637a5f 100644 --- a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -15,7 +15,7 @@ - {{cancelText}} + {{closeText}} {{okText}} @@ -31,7 +31,7 @@ initVueI18n } from '@dcloudio/uni-i18n' import messages from '../uni-popup/i18n/index.js' - const { t } = initVueI18n(messages) + const { t } = initVueI18n(messages) /** * PopUp 弹出层-对话框样式 * @description 弹出层-对话框样式 @@ -84,6 +84,14 @@ beforeClose: { type: Boolean, default: false + }, + cancelText:{ + type: String, + default: '' + }, + confirmText:{ + type: String, + default: '' } }, data() { @@ -95,10 +103,10 @@ }, computed: { okText() { - return t("uni-popup.ok") + return this.confirmText || t("uni-popup.ok") }, - cancelText() { - return t("uni-popup.cancel") + closeText() { + return this.cancelText || t("uni-popup.cancel") }, placeholderText() { return this.placeholder || t("uni-popup.placeholder") @@ -162,7 +170,7 @@ } - + diff --git a/uni_modules/uni-popup/package.json b/uni_modules/uni-popup/package.json index a214e474a8ce66bf702edd52a5db8bacab99ad20..9ff1de00b5f1920f96c763e9e01a9ba60a4d7ee7 100644 --- a/uni_modules/uni-popup/package.json +++ b/uni_modules/uni-popup/package.json @@ -1,90 +1,90 @@ -{ - "id": "uni-popup", - "displayName": "uni-popup 弹出层", - "version": "1.7.2", - "description": " Popup 组件,提供常用的弹层", - "keywords": [ - "uni-ui", - "弹出层", - "弹窗", - "popup", - "弹框" - ], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-transition" - ], - "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" - } - } - } - } -} +{ + "id": "uni-popup", + "displayName": "uni-popup 弹出层", + "version": "1.7.6", + "description": " Popup 组件,提供常用的弹层", + "keywords": [ + "uni-ui", + "弹出层", + "弹窗", + "popup", + "弹框" + ], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "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-popup/readme.md b/uni_modules/uni-popup/readme.md index fb661e7d0cda7dc4df2db62ef29b61df4887f36c..fdad4b3d7031e1165d6904d32b9f00e1ad011a51 100644 --- a/uni_modules/uni-popup/readme.md +++ b/uni_modules/uni-popup/readme.md @@ -1,17 +1,17 @@ - - -## Popup 弹出层 -> **组件名:uni-popup** -> 代码块: `uPopup` -> 关联组件:`uni-transition` - - -弹出层组件,在应用中弹出一个消息提示窗口、提示框等 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - - - + + +## Popup 弹出层 +> **组件名:uni-popup** +> 代码块: `uPopup` +> 关联组件:`uni-transition` + + +弹出层组件,在应用中弹出一个消息提示窗口、提示框等 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + + + + diff --git a/uni_modules/uni-rate/changelog.md b/uni_modules/uni-rate/changelog.md index 9fe0e841fb2ccf3533a5621bb5f54144ee3ad96c..67c302430842eb8ed2feca13b8831524237a7f38 100644 --- a/uni_modules/uni-rate/changelog.md +++ b/uni_modules/uni-rate/changelog.md @@ -1,5 +1,10 @@ -## 1.2.1(2021-07-30) -- 优化 vue3下事件警告的问题 +## 1.3.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-rate](https://uniapp.dcloud.io/component/uniui/uni-rate) +## 1.2.2(2021-09-10) +- 优化 默认值修改为 0 颗星 +## 1.2.1(2021-07-30) +- 优化 vue3下事件警告的问题 ## 1.2.0(2021-07-13) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) ## 1.1.2(2021-05-12) diff --git a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue index 082f6767c793e141754f4b7a2876322a3392bb21..3f3b535758d9f23e69eb8cbf3e79da50a6ce56e4 100644 --- a/uni_modules/uni-rate/components/uni-rate/uni-rate.vue +++ b/uni_modules/uni-rate/components/uni-rate/uni-rate.vue @@ -1,49 +1,20 @@