Commit fb097f7a5b07cc26957a61eac30b643fa59c5be3
1 parent
5934d6b0
uView版本升级到2.0.34
Showing
48 changed files
with
482 additions
and
410 deletions
yudao-ui-app/uni_modules/uview-ui/README.md
| 1 | 1 | <p align="center"> |
| 2 | 2 | <img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;"> |
| 3 | 3 | </p> |
| 4 | -<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3> | |
| 4 | +<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView 2.0</h3> | |
| 5 | 5 | <h3 align="center">多平台快速开发的UI框架</h3> |
| 6 | 6 | |
| 7 | +[](https://github.com/umicro/uView2.0) | |
| 8 | +[](https://github.com/umicro/uView2.0) | |
| 9 | +[](https://github.com/umicro/uView2.0/issues) | |
| 10 | +[](https://uviewui.com) | |
| 11 | +[](https://gitee.com/umicro/uView2.0/releases) | |
| 12 | +[](https://en.wikipedia.org/wiki/MIT_License) | |
| 13 | + | |
| 7 | 14 | ## 说明 |
| 8 | 15 | |
| 9 | -uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 | |
| 16 | +uView UI,是[uni-app](https://uniapp.dcloud.io/)全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 | |
| 10 | 17 | |
| 11 | -## 特性 | |
| 18 | +## [官方文档:https://uviewui.com](https://uviewui.com) | |
| 12 | 19 | |
| 13 | -- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序 | |
| 14 | -- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用 | |
| 15 | -- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨 | |
| 16 | -- 众多的常用页面和布局,让您专注逻辑,事半功倍 | |
| 17 | -- 详尽的文档支持,现代化的演示效果 | |
| 18 | -- 按需引入,精简打包体积 | |
| 19 | 20 | |
| 21 | +## 预览 | |
| 20 | 22 | |
| 21 | -## 安装 | |
| 23 | +您可以通过**微信**扫码,查看最佳的演示效果。 | |
| 24 | +<br> | |
| 25 | +<br> | |
| 26 | +<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" > | |
| 22 | 27 | |
| 23 | -```bash | |
| 24 | -# npm方式安装,插件市场导入无需执行此命令 | |
| 25 | -npm i uview-ui | |
| 26 | -``` | |
| 27 | 28 | |
| 28 | -## 快速上手 | |
| 29 | +## 链接 | |
| 29 | 30 | |
| 30 | -1. `main.js`引入uView库 | |
| 31 | -```js | |
| 32 | -// main.js | |
| 33 | -import uView from 'uview-ui'; | |
| 34 | -Vue.use(uView); | |
| 35 | -``` | |
| 31 | +- [官方文档](https://www.uviewui.com/) | |
| 32 | +- [更新日志](https://www.uviewui.com/components/changelog.html) | |
| 33 | +- [升级指南](https://www.uviewui.com/components/changeGuide.html) | |
| 34 | +- [关于我们](https://www.uviewui.com/cooperation/about.html) | |
| 36 | 35 | |
| 37 | -2. `App.vue`引入基础样式(注意style标签需声明scss属性支持) | |
| 38 | -```css | |
| 39 | -/* App.vue */ | |
| 40 | -<style lang="scss"> | |
| 41 | -@import "uview-ui/index.scss"; | |
| 42 | -</style> | |
| 43 | -``` | |
| 36 | +## 交流反馈 | |
| 44 | 37 | |
| 45 | -3. `uni.scss`引入全局scss变量文件 | |
| 46 | -```css | |
| 47 | -/* uni.scss */ | |
| 48 | -@import "uview-ui/theme.scss"; | |
| 49 | -``` | |
| 38 | +欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html) | |
| 50 | 39 | |
| 51 | -4. `pages.json`配置easycom规则(按需引入) | |
| 52 | - | |
| 53 | -```js | |
| 54 | -// pages.json | |
| 55 | -{ | |
| 56 | - "easycom": { | |
| 57 | - // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/" | |
| 58 | - // npm安装方式 | |
| 59 | - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" | |
| 60 | - // 下载安装方式 | |
| 61 | - // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" | |
| 62 | - }, | |
| 63 | - // 此为本身已有的内容 | |
| 64 | - "pages": [ | |
| 65 | - // ...... | |
| 66 | - ] | |
| 67 | -} | |
| 68 | -``` | |
| 40 | +## 关于PR | |
| 41 | + | |
| 42 | +> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uView2.0是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。 | |
| 43 | +> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢! | |
| 44 | + | |
| 45 | +## 安装 | |
| 46 | + | |
| 47 | +#### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593) | |
| 69 | 48 | |
| 70 | -请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容 | |
| 49 | +请通过[官网安装文档](https://www.uviewui.com/components/install.html)了解更详细的内容 | |
| 50 | + | |
| 51 | +## 快速上手 | |
| 52 | + | |
| 53 | +请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 | |
| 71 | 54 | |
| 72 | 55 | ## 使用方法 |
| 73 | 56 | 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 |
| ... | ... | @@ -78,27 +61,6 @@ Vue.use(uView); |
| 78 | 61 | </template> |
| 79 | 62 | ``` |
| 80 | 63 | |
| 81 | -请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容 | |
| 82 | - | |
| 83 | -## 链接 | |
| 84 | - | |
| 85 | -- [官方文档](https://www.uviewui.com/) | |
| 86 | -- [更新日志](https://www.www.uviewui.com/components/changelog.html) | |
| 87 | -- [升级指南](https://www.uviewui.com/components/changelog.html) | |
| 88 | -- [关于我们](https://www.uviewui.com/cooperation/about.html) | |
| 89 | - | |
| 90 | -## 预览 | |
| 91 | - | |
| 92 | -您可以通过**微信**扫码,查看最佳的演示效果。 | |
| 93 | -<br> | |
| 94 | -<br> | |
| 95 | -<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" > | |
| 96 | - | |
| 97 | -## 捐赠uView的研发 | |
| 98 | - | |
| 99 | -uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。 | |
| 100 | - | |
| 101 | -<img src="https://uviewui.com/common/alipay.png" width="220" ><img style="margin-left: 100px;" src="https://uviewui.com/common/wechat.png" width="220" > | |
| 102 | - | |
| 103 | 64 | ## 版权信息 |
| 104 | 65 | uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 |
| 66 | + | ... | ... |
yudao-ui-app/uni_modules/uview-ui/changelog.md
| 1 | +## 2.0.34(2022-09-25) | |
| 2 | +# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 3 | + | |
| 4 | +1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性 | |
| 5 | +2. 修复`route`方法调用可能报错的问题 | |
| 6 | +3. 修复`u-no-network`组件`z-index`无效的问题 | |
| 7 | +4. 修复`textarea`组件在h5上confirmType=""报错的问题 | |
| 8 | +5. `u-rate`适配`nvue` | |
| 9 | +6. 优化验证手机号码的正则表达式(根据工信部发布的《电信网编号计划(2017年版)》进行修改。) | |
| 10 | +7. `form-item`添加`labelPosition`属性 | |
| 11 | +8. `u-calendar`修复`maxDate`设置为当前日期,并且当前时间大于08:00时无法显示日期列表的问题 (#724) | |
| 12 | +9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680) | |
| 13 | +10. 修复`timeFormat`函数在safari重的兼容性问题 (#664) | |
| 14 | +## 2.0.33(2022-06-17) | |
| 15 | +# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 16 | + | |
| 17 | +1. 修复`loadmore`组件`lineColor`类型错误问题 | |
| 18 | +2. 修复`u-parse`组件`imgtap`、`linktap`不生效问题 | |
| 19 | +## 2.0.32(2022-06-16) | |
| 20 | +# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 21 | +1. `u-loadmore`新增自定义颜色、虚/实线 | |
| 22 | +2. 修复`u-swiper-action`组件部分平台不能上下滑动的问题 | |
| 23 | +3. 修复`u-list`回弹问题 | |
| 24 | +4. 修复`notice-bar`组件动画在低端安卓机可能会抖动的问题 | |
| 25 | +5. `u-loading-page`添加控制图标大小的属性`iconSize` | |
| 26 | +6. 修复`u-tooltip`组件`color`参数不生效的问题 | |
| 27 | +7. 修复`u--input`组件使用`blur`事件输出为`undefined`的bug | |
| 28 | +8. `u-code-input`组件新增键盘弹起时,是否自动上推页面参数`adjustPosition` | |
| 29 | +9. 修复`image`组件`load`事件无回调对象问题 | |
| 30 | +10. 修复`button`组件`loadingSize`设置无效问题 | |
| 31 | +10. 其他修复 | |
| 32 | +## 2.0.31(2022-04-19) | |
| 33 | +# uView2.0重磅发布,利剑出鞘,一统江湖 | |
| 34 | + | |
| 35 | +1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题 | |
| 36 | +2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题 | |
| 37 | +3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能) | |
| 38 | +4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题 | |
| 39 | +5. 其他修复 | |
| 1 | 40 | ## 2.0.30(2022-04-04) |
| 2 | 41 | # uView2.0重磅发布,利剑出鞘,一统江湖 |
| 3 | 42 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u--input/u--input.vue
| ... | ... | @@ -35,8 +35,9 @@ |
| 35 | 35 | :shape="shape" |
| 36 | 36 | :customStyle="customStyle" |
| 37 | 37 | :formatter="formatter" |
| 38 | + :ignoreCompositionEvent="ignoreCompositionEvent" | |
| 38 | 39 | @focus="$emit('focus')" |
| 39 | - @blur="$emit('blur')" | |
| 40 | + @blur="e => $emit('blur', e)" | |
| 40 | 41 | @keyboardheightchange="$emit('keyboardheightchange')" |
| 41 | 42 | @change="e => $emit('change', e)" |
| 42 | 43 | @input="e => $emit('input', e)" | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u--textarea/u--textarea.vue
yudao-ui-app/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
yudao-ui-app/uni_modules/uview-ui/components/u-button/u-button.vue
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | <template v-if="loading"> |
| 29 | 29 | <u-loading-icon |
| 30 | 30 | :mode="loadingMode" |
| 31 | - :size="textSize * 1.15" | |
| 31 | + :size="loadingSize * 1.15" | |
| 32 | 32 | :color="loadingColor" |
| 33 | 33 | ></u-loading-icon> |
| 34 | 34 | <text |
| ... | ... | @@ -75,7 +75,7 @@ |
| 75 | 75 | <template v-if="loading"> |
| 76 | 76 | <u-loading-icon |
| 77 | 77 | :mode="loadingMode" |
| 78 | - :size="textSize * 1.15" | |
| 78 | + :size="loadingSize * 1.15" | |
| 79 | 79 | :color="loadingColor" |
| 80 | 80 | ></u-loading-icon> |
| 81 | 81 | <text | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-calendar/u-calendar.vue
| ... | ... | @@ -209,12 +209,13 @@ export default { |
| 209 | 209 | } |
| 210 | 210 | }, |
| 211 | 211 | init() { |
| 212 | - // 校验maxDate,不能小于当前时间 | |
| 212 | + // 校验maxDate,不能小于minDate | |
| 213 | 213 | if ( |
| 214 | 214 | this.innerMaxDate && |
| 215 | - new Date(this.innerMaxDate).getTime() <= Date.now() | |
| 215 | + this.innerMinDate && | |
| 216 | + new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime() | |
| 216 | 217 | ) { |
| 217 | - return uni.$u.error('maxDate不能小于当前时间') | |
| 218 | + return uni.$u.error('maxDate不能小于minDate') | |
| 218 | 219 | } |
| 219 | 220 | // 滚动区域的高度 |
| 220 | 221 | this.listHeight = this.rowHeight * 5 + 30 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-code-input/props.js
yudao-ui-app/uni_modules/uview-ui/components/u-code-input/u-code-input.vue
| ... | ... | @@ -23,7 +23,9 @@ |
| 23 | 23 | v-if="mode === 'line'" |
| 24 | 24 | :style="[lineStyle]" |
| 25 | 25 | ></view> |
| 26 | - <view v-if="codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view> | |
| 26 | + <!-- #ifndef APP-PLUS --> | |
| 27 | + <view v-if="isFocus && codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view> | |
| 28 | + <!-- #endif --> | |
| 27 | 29 | </view> |
| 28 | 30 | <input |
| 29 | 31 | :disabled="disabledKeyboard" |
| ... | ... | @@ -31,11 +33,14 @@ |
| 31 | 33 | :focus="focus" |
| 32 | 34 | :value="inputValue" |
| 33 | 35 | :maxlength="maxlength" |
| 36 | + :adjustPosition="adjustPosition" | |
| 34 | 37 | class="u-code-input__input" |
| 35 | 38 | @input="inputHandler" |
| 36 | 39 | :style="{ |
| 37 | 40 | height: $u.addUnit(size) |
| 38 | 41 | }" |
| 42 | + @focus="isFocus = true" | |
| 43 | + @blur="isFocus = false" | |
| 39 | 44 | /> |
| 40 | 45 | </view> |
| 41 | 46 | </template> |
| ... | ... | @@ -70,7 +75,8 @@ |
| 70 | 75 | mixins: [uni.$u.mpMixin, uni.$u.mixin, props], |
| 71 | 76 | data() { |
| 72 | 77 | return { |
| 73 | - inputValue: '' | |
| 78 | + inputValue: '', | |
| 79 | + isFocus: this.focus | |
| 74 | 80 | } |
| 75 | 81 | }, |
| 76 | 82 | watch: { |
| ... | ... | @@ -203,6 +209,7 @@ |
| 203 | 209 | width: 40px; |
| 204 | 210 | background-color: $u-content-color; |
| 205 | 211 | } |
| 212 | + /* #ifndef APP-PLUS */ | |
| 206 | 213 | &__cursor { |
| 207 | 214 | position: absolute; |
| 208 | 215 | top: 50%; |
| ... | ... | @@ -212,6 +219,8 @@ |
| 212 | 219 | height: $u-code-input-cursor-height; |
| 213 | 220 | animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite; |
| 214 | 221 | } |
| 222 | + /* #endif */ | |
| 223 | + | |
| 215 | 224 | } |
| 216 | 225 | |
| 217 | 226 | &__input { |
| ... | ... | @@ -226,6 +235,7 @@ |
| 226 | 235 | } |
| 227 | 236 | } |
| 228 | 237 | |
| 238 | + /* #ifndef APP-PLUS */ | |
| 229 | 239 | @keyframes u-cursor-flicker { |
| 230 | 240 | 0% { |
| 231 | 241 | opacity: 0; |
| ... | ... | @@ -237,4 +247,6 @@ |
| 237 | 247 | opacity: 0; |
| 238 | 248 | } |
| 239 | 249 | } |
| 250 | + /* #endif */ | |
| 251 | + | |
| 240 | 252 | </style> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-code/u-code.vue
| ... | ... | @@ -16,11 +16,11 @@ |
| 16 | 16 | * @property {String} endText 倒计结束的提示语,见官网说明(默认 '重新获取' ) |
| 17 | 17 | * @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时( 默认false ) |
| 18 | 18 | * @property {String} uniqueKey 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了 |
| 19 | - * | |
| 19 | + * | |
| 20 | 20 | * @event {Function} change 倒计时期间,每秒触发一次 |
| 21 | 21 | * @event {Function} start 开始倒计时触发 |
| 22 | 22 | * @event {Function} end 结束倒计时触发 |
| 23 | - * @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code> | |
| 23 | + * @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code> | |
| 24 | 24 | */ |
| 25 | 25 | export default { |
| 26 | 26 | name: "u-code", |
| ... | ... | @@ -74,7 +74,6 @@ |
| 74 | 74 | this.canGetCode = false |
| 75 | 75 | // 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示 |
| 76 | 76 | this.changeEvent(this.changeText.replace(/x|X/, this.secNum)) |
| 77 | - this.setTimeToStorage() | |
| 78 | 77 | this.timer = setInterval(() => { |
| 79 | 78 | if (--this.secNum) { |
| 80 | 79 | // 用当前倒计时的秒数替换提示字符串中的"x"字母 |
| ... | ... | @@ -88,7 +87,8 @@ |
| 88 | 87 | this.canGetCode = true |
| 89 | 88 | } |
| 90 | 89 | }, 1000) |
| 91 | - }, | |
| 90 | + this.setTimeToStorage() | |
| 91 | + }, | |
| 92 | 92 | // 重置,可以让用户再次获取验证码 |
| 93 | 93 | reset() { |
| 94 | 94 | this.canGetCode = true | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue
| 1 | 1 | <template> |
| 2 | - <view class="u-drawdown-item"> | |
| 3 | - <u-overlay | |
| 4 | - customStyle="top: 126px" | |
| 5 | - :show="show" | |
| 6 | - :closeOnClickOverlay="closeOnClickOverlay" | |
| 7 | - @click="overlayClick" | |
| 8 | - ></u-overlay> | |
| 9 | - <view | |
| 10 | - class="u-drawdown-item__content" | |
| 11 | - :style="[style]" | |
| 12 | - :animation="animationData" | |
| 13 | - ref="animation" | |
| 14 | - > | |
| 15 | - <slot /> | |
| 16 | - </view> | |
| 17 | - </view> | |
| 2 | + <view class="u-drawdown"> | |
| 3 | + <view | |
| 4 | + class="u-dropdown__menu" | |
| 5 | + :style="{ | |
| 6 | + height: $u.addUnit(height) | |
| 7 | + }" | |
| 8 | + ref="u-dropdown__menu" | |
| 9 | + > | |
| 10 | + <view | |
| 11 | + class="u-dropdown__menu__item" | |
| 12 | + v-for="(item, index) in menuList" | |
| 13 | + :key="index" | |
| 14 | + @tap.stop="clickHandler(item, index)" | |
| 15 | + > | |
| 16 | + <view class="u-dropdown__menu__item__content"> | |
| 17 | + <text | |
| 18 | + class="u-dropdown__menu__item__content__text" | |
| 19 | + :style="[index === current ? activeStyle : inactiveStyle]" | |
| 20 | + >{{item.title}}</text> | |
| 21 | + <view | |
| 22 | + class="u-dropdown__menu__item__content__arrow" | |
| 23 | + :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']" | |
| 24 | + > | |
| 25 | + <u-icon | |
| 26 | + :name="menuIcon" | |
| 27 | + :size="$u.addUnit(menuIconSize)" | |
| 28 | + ></u-icon> | |
| 29 | + </view> | |
| 30 | + </view> | |
| 31 | + </view> | |
| 32 | + </view> | |
| 33 | + <view class="u-dropdown__content"> | |
| 34 | + <slot /> | |
| 35 | + </view> | |
| 36 | + </view> | |
| 18 | 37 | </template> |
| 19 | 38 | |
| 20 | 39 | <script> |
| 21 | - // #ifdef APP-NVUE | |
| 22 | - const animation = uni.requireNativePlugin('animation') | |
| 23 | - const dom = uni.requireNativePlugin('dom') | |
| 24 | - // #endif | |
| 25 | - import props from './props.js'; | |
| 26 | - /** | |
| 27 | - * Drawdownitem | |
| 28 | - * @description | |
| 29 | - * @tutorial url | |
| 30 | - * @property {String} | |
| 31 | - * @event {Function} | |
| 32 | - * @example | |
| 33 | - */ | |
| 34 | - export default { | |
| 35 | - name: 'u-drawdown-item', | |
| 36 | - mixins: [uni.$u.mpMixin, uni.$u.mixin, props], | |
| 37 | - data() { | |
| 38 | - return { | |
| 39 | - show: false, | |
| 40 | - top: '126px', | |
| 41 | - // uni.createAnimation的导出数据 | |
| 42 | - animationData: {}, | |
| 43 | - } | |
| 44 | - }, | |
| 45 | - mounted() { | |
| 46 | - this.init() | |
| 47 | - }, | |
| 48 | - watch: { | |
| 49 | - // 发生变化时,需要去更新父组件对应的值 | |
| 50 | - dataChange(newValue, oldValue) { | |
| 51 | - this.updateParentData() | |
| 52 | - } | |
| 53 | - }, | |
| 54 | - computed: { | |
| 55 | - // 监听对应变量的变化 | |
| 56 | - dataChange() { | |
| 57 | - return [this.title, this.disabled] | |
| 58 | - }, | |
| 59 | - style() { | |
| 60 | - const style = { | |
| 61 | - zIndex: 10071, | |
| 62 | - position: 'fixed', | |
| 63 | - display: 'flex', | |
| 64 | - left: 0, | |
| 65 | - right: 0 | |
| 66 | - } | |
| 67 | - style.top = uni.$u.addUnit(this.top) | |
| 68 | - return style | |
| 69 | - } | |
| 70 | - }, | |
| 71 | - methods: { | |
| 72 | - init() { | |
| 73 | - this.updateParentData() | |
| 74 | - }, | |
| 75 | - // 更新父组件所需的数据 | |
| 76 | - updateParentData() { | |
| 77 | - // 获取父组件u-dropdown | |
| 78 | - this.getParentData('u-dropdown') | |
| 79 | - if (!this.parent) uni.$u.error('u-dropdown-item必须配合u-dropdown使用') | |
| 80 | - // 查找父组件menuList数组中对应的标题数据 | |
| 81 | - const menuIndex = this.parent.menuList.findIndex(item => item.title === this.title) | |
| 82 | - const menuContent = { | |
| 83 | - title: this.title, | |
| 84 | - disabled: this.disabled | |
| 85 | - } | |
| 86 | - if (menuIndex >= 0) { | |
| 87 | - // 如果能找到,则直接修改 | |
| 88 | - this.parent.menuList[menuIndex] = menuContent; | |
| 89 | - } else { | |
| 90 | - // 如果无法找到,则为第一次添加,直接push即可 | |
| 91 | - this.parent.menuList.push(menuContent); | |
| 92 | - } | |
| 93 | - }, | |
| 94 | - async setContentAnimate(height) { | |
| 95 | - this.animating = true | |
| 96 | - // #ifdef APP-NVUE | |
| 97 | - const ref = this.$refs['animation'].ref | |
| 98 | - animation.transition(ref, { | |
| 99 | - styles: { | |
| 100 | - height: uni.$u.addUnit(height) | |
| 101 | - }, | |
| 102 | - duration: this.duration, | |
| 103 | - timingFunction: 'ease-in-out', | |
| 104 | - }, () => { | |
| 105 | - this.animating = false | |
| 106 | - }) | |
| 107 | - // #endif | |
| 108 | - | |
| 109 | - // #ifndef APP-NVUE | |
| 110 | - const animation = uni.createAnimation({ | |
| 111 | - timingFunction: 'ease-in-out', | |
| 112 | - }); | |
| 113 | - animation | |
| 114 | - .height(height) | |
| 115 | - .step({ | |
| 116 | - duration: this.duration, | |
| 117 | - }) | |
| 118 | - .step() | |
| 119 | - // 导出动画数据给面板的animationData值 | |
| 120 | - this.animationData = animation.export() | |
| 121 | - // 标识动画结束 | |
| 122 | - uni.$u.sleep(this.duration).then(() => { | |
| 123 | - this.animating = false | |
| 124 | - }) | |
| 125 | - // #endif | |
| 126 | - }, | |
| 127 | - overlayClick() { | |
| 128 | - this.show = false | |
| 129 | - this.setContentAnimate(0) | |
| 130 | - } | |
| 131 | - }, | |
| 132 | - } | |
| 40 | +import props from './props.js'; | |
| 41 | +/** | |
| 42 | + * Dropdown | |
| 43 | + * @description | |
| 44 | + * @tutorial url | |
| 45 | + * @property {String} | |
| 46 | + * @event {Function} | |
| 47 | + * @example | |
| 48 | + */ | |
| 49 | +export default { | |
| 50 | + name: 'u-dropdown', | |
| 51 | + mixins: [uni.$u.mixin, props], | |
| 52 | + data() { | |
| 53 | + return { | |
| 54 | + // �˵����� | |
| 55 | + menuList: [], | |
| 56 | + current: 0 | |
| 57 | + } | |
| 58 | + }, | |
| 59 | + computed: { | |
| 60 | + | |
| 61 | + }, | |
| 62 | + created() { | |
| 63 | + // �������������(u-dropdown-item)��this��������data��������������������С��������ѭ�����ö����� | |
| 64 | + this.children = []; | |
| 65 | + }, | |
| 66 | + methods: { | |
| 67 | + clickHandler(item, index) { | |
| 68 | + this.children.map(child => { | |
| 69 | + if(child.title === item.title) { | |
| 70 | + // this.queryRect('u-dropdown__menu').then(size => { | |
| 71 | + child.$emit('click') | |
| 72 | + child.setContentAnimate(child.show ? 0 : 300) | |
| 73 | + child.show = !child.show | |
| 74 | + // }) | |
| 75 | + } else { | |
| 76 | + child.show = false | |
| 77 | + child.setContentAnimate(0) | |
| 78 | + } | |
| 79 | + }) | |
| 80 | + }, | |
| 81 | + // ��ȡ��ǩ�ijߴ�λ�� | |
| 82 | + queryRect(el) { | |
| 83 | + // #ifndef APP-NVUE | |
| 84 | + // $uGetRectΪuView�Դ��Ľڵ��ѯ����������ĵ����ܣ�https://www.uviewui.com/js/getRect.html | |
| 85 | + // ����ڲ�һ����this.$uGetRect�������Ϊthis.$u.getRect�����߹���һ�£����Ʋ�ͬ | |
| 86 | + return new Promise(resolve => { | |
| 87 | + this.$uGetRect(`.${el}`).then(size => { | |
| 88 | + resolve(size) | |
| 89 | + }) | |
| 90 | + }) | |
| 91 | + // #endif | |
| 92 | + | |
| 93 | + // #ifdef APP-NVUE | |
| 94 | + // nvue�£�ʹ��domģ���ѯԪ�ظ߶� | |
| 95 | + // ����һ��promise���õ��ô˷�����������ʹ��then�ص� | |
| 96 | + return new Promise(resolve => { | |
| 97 | + dom.getComponentRect(this.$refs[el], res => { | |
| 98 | + resolve(res.size) | |
| 99 | + }) | |
| 100 | + }) | |
| 101 | + // #endif | |
| 102 | + }, | |
| 103 | + }, | |
| 104 | +} | |
| 133 | 105 | </script> |
| 134 | 106 | |
| 135 | -<style lang="scss" scoped> | |
| 136 | - @import '../../libs/css/components.scss'; | |
| 137 | - | |
| 138 | - .u-drawdown-item { | |
| 139 | - | |
| 140 | - &__content { | |
| 141 | - background-color: #FFFFFF; | |
| 142 | - overflow: hidden; | |
| 143 | - height: 0; | |
| 144 | - } | |
| 145 | - } | |
| 107 | +<style lang="scss"> | |
| 108 | +@import '../../libs/css/components.scss'; | |
| 109 | + | |
| 110 | +.u-dropdown { | |
| 111 | + | |
| 112 | + &__menu { | |
| 113 | + @include flex; | |
| 114 | + | |
| 115 | + &__item { | |
| 116 | + flex: 1; | |
| 117 | + @include flex; | |
| 118 | + justify-content: center; | |
| 119 | + | |
| 120 | + &__content { | |
| 121 | + @include flex; | |
| 122 | + align-items: center; | |
| 123 | + } | |
| 124 | + } | |
| 125 | + } | |
| 126 | +} | |
| 146 | 127 | </style> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue
| 1 | 1 | <template> |
| 2 | - <view class="u-drawdown"> | |
| 3 | - <view | |
| 4 | - class="u-dropdown__menu" | |
| 5 | - :style="{ | |
| 2 | + <view class="u-drawdown"> | |
| 3 | + <view | |
| 4 | + class="u-dropdown__menu" | |
| 5 | + :style="{ | |
| 6 | 6 | height: $u.addUnit(height) |
| 7 | 7 | }" |
| 8 | - ref="u-dropdown__menu" | |
| 9 | - > | |
| 10 | - <view | |
| 11 | - class="u-dropdown__menu__item" | |
| 12 | - v-for="(item, index) in menuList" | |
| 13 | - :key="index" | |
| 14 | - @tap.stop="clickHandler(item, index)" | |
| 15 | - > | |
| 16 | - <view class="u-dropdown__menu__item__content"> | |
| 17 | - <text | |
| 18 | - class="u-dropdown__menu__item__content__text" | |
| 19 | - :style="[index === current ? activeStyle : inactiveStyle]" | |
| 20 | - >{{item.title}}</text> | |
| 21 | - <view | |
| 22 | - class="u-dropdown__menu__item__content__arrow" | |
| 23 | - :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']" | |
| 24 | - > | |
| 25 | - <u-icon | |
| 26 | - :name="menuIcon" | |
| 27 | - :size="$u.addUnit(menuIconSize)" | |
| 28 | - ></u-icon> | |
| 29 | - </view> | |
| 30 | - </view> | |
| 31 | - </view> | |
| 32 | - </view> | |
| 33 | - <view class="u-dropdown__content"> | |
| 34 | - <slot /> | |
| 35 | - </view> | |
| 36 | - </view> | |
| 8 | + ref="u-dropdown__menu" | |
| 9 | + > | |
| 10 | + <view | |
| 11 | + class="u-dropdown__menu__item" | |
| 12 | + v-for="(item, index) in menuList" | |
| 13 | + :key="index" | |
| 14 | + @tap.stop="clickHandler(item, index)" | |
| 15 | + > | |
| 16 | + <view class="u-dropdown__menu__item__content"> | |
| 17 | + <text | |
| 18 | + class="u-dropdown__menu__item__content__text" | |
| 19 | + :style="[index === current ? activeStyle : inactiveStyle]" | |
| 20 | + >{{item.title}}</text> | |
| 21 | + <view | |
| 22 | + class="u-dropdown__menu__item__content__arrow" | |
| 23 | + :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']" | |
| 24 | + > | |
| 25 | + <u-icon | |
| 26 | + :name="menuIcon" | |
| 27 | + :size="$u.addUnit(menuIconSize)" | |
| 28 | + ></u-icon> | |
| 29 | + </view> | |
| 30 | + </view> | |
| 31 | + </view> | |
| 32 | + </view> | |
| 33 | + <view class="u-dropdown__content"> | |
| 34 | + <slot /> | |
| 35 | + </view> | |
| 36 | + </view> | |
| 37 | 37 | </template> |
| 38 | 38 | |
| 39 | 39 | <script> |
| 40 | - import props from './props.js'; | |
| 41 | - /** | |
| 42 | - * Dropdown | |
| 43 | - * @description | |
| 44 | - * @tutorial url | |
| 45 | - * @property {String} | |
| 46 | - * @event {Function} | |
| 47 | - * @example | |
| 48 | - */ | |
| 49 | - export default { | |
| 50 | - name: 'u-dropdown', | |
| 51 | - mixins: [uni.$u.mixin, props], | |
| 52 | - data() { | |
| 53 | - return { | |
| 54 | - // 菜单数组 | |
| 55 | - menuList: [], | |
| 56 | - current: 0 | |
| 57 | - } | |
| 58 | - }, | |
| 59 | - computed: { | |
| 60 | - | |
| 61 | - }, | |
| 62 | - created() { | |
| 63 | - // 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错 | |
| 64 | - this.children = []; | |
| 65 | - }, | |
| 66 | - methods: { | |
| 67 | - clickHandler(item, index) { | |
| 68 | - this.children.map(child => { | |
| 69 | - if(child.title === item.title) { | |
| 70 | - // this.queryRect('u-dropdown__menu').then(size => { | |
| 71 | - child.$emit('click') | |
| 72 | - child.setContentAnimate(child.show ? 0 : 300) | |
| 73 | - child.show = !child.show | |
| 74 | - // }) | |
| 75 | - } else { | |
| 76 | - child.show = false | |
| 77 | - child.setContentAnimate(0) | |
| 78 | - } | |
| 79 | - }) | |
| 80 | - }, | |
| 81 | - // 获取标签的尺寸位置 | |
| 82 | - queryRect(el) { | |
| 83 | - // #ifndef APP-NVUE | |
| 84 | - // $uGetRect为uView自带的节点查询简化方法,详见文档介绍:https://www.uviewui.com/js/getRect.html | |
| 85 | - // 组件内部一般用this.$uGetRect,对外的为this.$u.getRect,二者功能一致,名称不同 | |
| 86 | - return new Promise(resolve => { | |
| 87 | - this.$uGetRect(`.${el}`).then(size => { | |
| 88 | - resolve(size) | |
| 89 | - }) | |
| 90 | - }) | |
| 91 | - // #endif | |
| 92 | - | |
| 93 | - // #ifdef APP-NVUE | |
| 94 | - // nvue下,使用dom模块查询元素高度 | |
| 95 | - // 返回一个promise,让调用此方法的主体能使用then回调 | |
| 96 | - return new Promise(resolve => { | |
| 97 | - dom.getComponentRect(this.$refs[el], res => { | |
| 98 | - resolve(res.size) | |
| 99 | - }) | |
| 100 | - }) | |
| 101 | - // #endif | |
| 102 | - }, | |
| 103 | - }, | |
| 104 | - } | |
| 40 | +import props from './props.js'; | |
| 41 | +/** | |
| 42 | + * Dropdown | |
| 43 | + * @description | |
| 44 | + * @tutorial url | |
| 45 | + * @property {String} | |
| 46 | + * @event {Function} | |
| 47 | + * @example | |
| 48 | + */ | |
| 49 | +export default { | |
| 50 | + name: 'u-dropdown', | |
| 51 | + mixins: [uni.$u.mixin, props], | |
| 52 | + data() { | |
| 53 | + return { | |
| 54 | + // 锟剿碉拷锟斤拷锟斤拷 | |
| 55 | + menuList: [], | |
| 56 | + current: 0 | |
| 57 | + } | |
| 58 | + }, | |
| 59 | + computed: { | |
| 60 | + | |
| 61 | + }, | |
| 62 | + created() { | |
| 63 | + // 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟(u-dropdown-item)锟斤拷this锟斤拷锟斤拷锟斤拷锟斤拷data锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷微锟斤拷小锟斤拷锟斤拷锟斤拷锟斤拷循锟斤拷锟斤拷锟矫讹拷锟斤拷锟斤拷 | |
| 64 | + this.children = []; | |
| 65 | + }, | |
| 66 | + methods: { | |
| 67 | + clickHandler(item, index) { | |
| 68 | + this.children.map(child => { | |
| 69 | + if(child.title === item.title) { | |
| 70 | + // this.queryRect('u-dropdown__menu').then(size => { | |
| 71 | + child.$emit('click') | |
| 72 | + child.setContentAnimate(child.show ? 0 : 300) | |
| 73 | + child.show = !child.show | |
| 74 | + // }) | |
| 75 | + } else { | |
| 76 | + child.show = false | |
| 77 | + child.setContentAnimate(0) | |
| 78 | + } | |
| 79 | + }) | |
| 80 | + }, | |
| 81 | + // 锟斤拷取锟斤拷签锟侥尺达拷位锟斤拷 | |
| 82 | + queryRect(el) { | |
| 83 | + // #ifndef APP-NVUE | |
| 84 | + // $uGetRect为uView锟皆达拷锟侥节碉拷锟窖拷蚧锟斤拷锟斤拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟杰o拷https://www.uviewui.com/js/getRect.html | |
| 85 | + // 锟斤拷锟斤拷诓锟揭伙拷锟斤拷锟絫his.$uGetRect锟斤拷锟斤拷锟斤拷锟轿猼his.$u.getRect锟斤拷锟斤拷锟竭癸拷锟斤拷一锟铰o拷锟斤拷锟狡诧拷同 | |
| 86 | + return new Promise(resolve => { | |
| 87 | + this.$uGetRect(`.${el}`).then(size => { | |
| 88 | + resolve(size) | |
| 89 | + }) | |
| 90 | + }) | |
| 91 | + // #endif | |
| 92 | + | |
| 93 | + // #ifdef APP-NVUE | |
| 94 | + // nvue锟铰o拷使锟斤拷dom模锟斤拷锟窖拷馗叨锟 | |
| 95 | + // 锟斤拷锟斤拷一锟斤拷promise锟斤拷锟矫碉拷锟矫此凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷使锟斤拷then锟截碉拷 | |
| 96 | + return new Promise(resolve => { | |
| 97 | + dom.getComponentRect(this.$refs[el], res => { | |
| 98 | + resolve(res.size) | |
| 99 | + }) | |
| 100 | + }) | |
| 101 | + // #endif | |
| 102 | + }, | |
| 103 | + }, | |
| 104 | +} | |
| 105 | 105 | </script> |
| 106 | 106 | |
| 107 | 107 | <style lang="scss"> |
| 108 | - @import '../../libs/css/components.scss'; | |
| 108 | +@import '../../libs/css/components.scss'; | |
| 109 | 109 | |
| 110 | - .u-dropdown { | |
| 111 | - | |
| 112 | - &__menu { | |
| 113 | - @include flex; | |
| 114 | - | |
| 115 | - &__item { | |
| 116 | - flex: 1; | |
| 117 | - @include flex; | |
| 118 | - justify-content: center; | |
| 119 | - | |
| 120 | - &__content { | |
| 121 | - @include flex; | |
| 122 | - align-items: center; | |
| 123 | - } | |
| 124 | - } | |
| 125 | - } | |
| 126 | - } | |
| 110 | +.u-dropdown { | |
| 111 | + | |
| 112 | + &__menu { | |
| 113 | + @include flex; | |
| 114 | + | |
| 115 | + &__item { | |
| 116 | + flex: 1; | |
| 117 | + @include flex; | |
| 118 | + justify-content: center; | |
| 119 | + | |
| 120 | + &__content { | |
| 121 | + @include flex; | |
| 122 | + align-items: center; | |
| 123 | + } | |
| 124 | + } | |
| 125 | + } | |
| 126 | +} | |
| 127 | 127 | </style> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-form-item/props.js
| ... | ... | @@ -15,6 +15,11 @@ export default { |
| 15 | 15 | type: [String, Boolean], |
| 16 | 16 | default: uni.$u.props.formItem.borderBottom |
| 17 | 17 | }, |
| 18 | + // label的位置,left-左边,top-上边 | |
| 19 | + labelPosition: { | |
| 20 | + type: String, | |
| 21 | + default: uni.$u.props.formItem.labelPosition | |
| 22 | + }, | |
| 18 | 23 | // label的宽度,单位px |
| 19 | 24 | labelWidth: { |
| 20 | 25 | type: [String, Number], | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-form-item/u-form-item.vue
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | class="u-form-item__body" |
| 5 | 5 | @tap="clickHandler" |
| 6 | 6 | :style="[$u.addStyle(customStyle), { |
| 7 | - flexDirection: parentData.labelPosition === 'left' ? 'row' : 'column' | |
| 7 | + flexDirection: (labelPosition || parentData.labelPosition) === 'left' ? 'row' : 'column' | |
| 8 | 8 | }]" |
| 9 | 9 | > |
| 10 | 10 | <!-- 微信小程序中,将一个参数设置空字符串,结果会变成字符串"true" --> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-image/u-image.vue
| ... | ... | @@ -161,10 +161,10 @@ |
| 161 | 161 | this.$emit('error', err) |
| 162 | 162 | }, |
| 163 | 163 | // 图片加载完成,标记loading结束 |
| 164 | - onLoadHandler() { | |
| 164 | + onLoadHandler(event) { | |
| 165 | 165 | this.loading = false |
| 166 | 166 | this.isError = false |
| 167 | - this.$emit('load') | |
| 167 | + this.$emit('load', event) | |
| 168 | 168 | this.removeBgColor() |
| 169 | 169 | // 如果不需要动画效果,就不执行下方代码,同时移除加载时的背景颜色 |
| 170 | 170 | // 否则无需fade效果时,png图片依然能看到下方的背景色 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-input/props.js
yudao-ui-app/uni_modules/uview-ui/components/u-input/u-input.vue
| ... | ... | @@ -38,6 +38,7 @@ |
| 38 | 38 | :selection-end="selectionEnd" |
| 39 | 39 | :selection-start="selectionStart" |
| 40 | 40 | :password="password || type === 'password' || undefined" |
| 41 | + :ignoreCompositionEvent="ignoreCompositionEvent" | |
| 41 | 42 | @input="onInput" |
| 42 | 43 | @blur="onBlur" |
| 43 | 44 | @focus="onFocus" |
| ... | ... | @@ -114,7 +115,7 @@ import props from "./props.js"; |
| 114 | 115 | * @property {Boolean} readonly 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false ) |
| 115 | 116 | * @property {String} shape 输入框形状,circle-圆形,square-方形 ( 默认 'square' ) |
| 116 | 117 | * @property {Object} customStyle 定义需要用到的外部样式 |
| 117 | - * | |
| 118 | + * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理。 | |
| 118 | 119 | * @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" /> |
| 119 | 120 | */ |
| 120 | 121 | export default { | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-line/props.js
yudao-ui-app/uni_modules/uview-ui/components/u-list/u-list.vue
yudao-ui-app/uni_modules/uview-ui/components/u-loading-page/props.js
| ... | ... | @@ -35,6 +35,11 @@ export default { |
| 35 | 35 | type: [String, Number], |
| 36 | 36 | default: uni.$u.props.loadingPage.fontSize |
| 37 | 37 | }, |
| 38 | + // 图标大小 | |
| 39 | + iconSize: { | |
| 40 | + type: [String, Number], | |
| 41 | + default: uni.$u.props.loadingPage.fontSize | |
| 42 | + }, | |
| 38 | 43 | // 加载中图标的颜色,只能rgb或者十六进制颜色值 |
| 39 | 44 | loadingColor: { |
| 40 | 45 | type: String, | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue
| ... | ... | @@ -19,11 +19,15 @@ |
| 19 | 19 | :src="image" |
| 20 | 20 | class="u-loading-page__warpper__loading-icon__img" |
| 21 | 21 | mode="widthFit" |
| 22 | + :style="{ | |
| 23 | + width: $u.addUnit(iconSize), | |
| 24 | + height: $u.addUnit(iconSize) | |
| 25 | + }" | |
| 22 | 26 | ></image> |
| 23 | 27 | <u-loading-icon |
| 24 | 28 | v-else |
| 25 | 29 | :mode="loadingMode" |
| 26 | - size="28" | |
| 30 | + :size="$u.addUnit(iconSize)" | |
| 27 | 31 | :color="loadingColor" |
| 28 | 32 | ></u-loading-icon> |
| 29 | 33 | </view> |
| ... | ... | @@ -55,6 +59,7 @@ import props from "./props.js"; |
| 55 | 59 | * @property {String} bgColor 背景色 (默认 '#ffffff' ) |
| 56 | 60 | * @property {String} color 文字颜色 (默认 '#C8C8C8' ) |
| 57 | 61 | * @property {String | Number} fontSize 文字大小 (默认 19 ) |
| 62 | + * @property {String | Number} iconSize 图标大小 (默认 28 ) | |
| 58 | 63 | * @property {String} loadingColor 加载中图标的颜色,只能rgb或者十六进制颜色值 (默认 '#C8C8C8' ) |
| 59 | 64 | * @property {Object} customStyle 自定义样式 |
| 60 | 65 | * @example <u-loading mode="circle"></u-loading> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-loadmore/props.js
| ... | ... | @@ -20,12 +20,16 @@ export default { |
| 20 | 20 | type: [String, Number], |
| 21 | 21 | default: uni.$u.props.loadmore.fontSize |
| 22 | 22 | }, |
| 23 | + // 图标大小 | |
| 24 | + iconSize: { | |
| 25 | + type: [String, Number], | |
| 26 | + default: uni.$u.props.loadmore.iconSize | |
| 27 | + }, | |
| 23 | 28 | // 字体颜色 |
| 24 | 29 | color: { |
| 25 | 30 | type: String, |
| 26 | 31 | default: uni.$u.props.loadmore.color |
| 27 | 32 | }, |
| 28 | - | |
| 29 | 33 | // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆 |
| 30 | 34 | loadingIcon: { |
| 31 | 35 | type: String, |
| ... | ... | @@ -75,6 +79,16 @@ export default { |
| 75 | 79 | line: { |
| 76 | 80 | type: Boolean, |
| 77 | 81 | default: uni.$u.props.loadmore.line |
| 82 | + }, | |
| 83 | + // 线条颜色 | |
| 84 | + lineColor: { | |
| 85 | + type: String, | |
| 86 | + default: uni.$u.props.loadmore.lineColor | |
| 87 | + }, | |
| 88 | + // 是否虚线,true-虚线,false-实线 | |
| 89 | + dashed: { | |
| 90 | + type: Boolean, | |
| 91 | + default: uni.$u.props.loadmore.dashed | |
| 78 | 92 | } |
| 79 | 93 | } |
| 80 | 94 | } | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue
| ... | ... | @@ -13,8 +13,9 @@ |
| 13 | 13 | > |
| 14 | 14 | <u-line |
| 15 | 15 | length="140rpx" |
| 16 | - color="#E6E8EB" | |
| 16 | + :color="lineColor" | |
| 17 | 17 | :hairline="false" |
| 18 | + :dashed="dashed" | |
| 18 | 19 | v-if="line" |
| 19 | 20 | ></u-line> |
| 20 | 21 | <!-- 加载中和没有更多的状态才显示两边的横线 --> |
| ... | ... | @@ -28,7 +29,7 @@ |
| 28 | 29 | > |
| 29 | 30 | <u-loading-icon |
| 30 | 31 | :color="iconColor" |
| 31 | - size="17" | |
| 32 | + :size="iconSize" | |
| 32 | 33 | :mode="loadingIcon" |
| 33 | 34 | ></u-loading-icon> |
| 34 | 35 | </view> |
| ... | ... | @@ -42,8 +43,9 @@ |
| 42 | 43 | </view> |
| 43 | 44 | <u-line |
| 44 | 45 | length="140rpx" |
| 45 | - color="#E6E8EB" | |
| 46 | + :color="lineColor" | |
| 46 | 47 | :hairline="false" |
| 48 | + :dashed="dashed" | |
| 47 | 49 | v-if="line" |
| 48 | 50 | ></u-line> |
| 49 | 51 | </view> |
| ... | ... | @@ -60,6 +62,7 @@ |
| 60 | 62 | * @property {String} bgColor 组件背景颜色,在页面是非白色时会用到(默认 'transparent' ) |
| 61 | 63 | * @property {Boolean} icon 加载中时是否显示图标(默认 true ) |
| 62 | 64 | * @property {String | Number} fontSize 字体大小(默认 14 ) |
| 65 | + * @property {String | Number} iconSize 图标大小(默认 17 ) | |
| 63 | 66 | * @property {String} color 字体颜色(默认 '#606266' ) |
| 64 | 67 | * @property {String} loadingIcon 加载图标(默认 'circle' ) |
| 65 | 68 | * @property {String} loadmoreText 加载前的提示语(默认 '加载更多' ) |
| ... | ... | @@ -67,10 +70,12 @@ |
| 67 | 70 | * @property {String} nomoreText 没有更多的提示语(默认 '没有更多了' ) |
| 68 | 71 | * @property {Boolean} isDot 到上一个相邻元素的距离 (默认 false ) |
| 69 | 72 | * @property {String} iconColor 加载中图标的颜色 (默认 '#b7b7b7' ) |
| 73 | + * @property {String} lineColor 线条颜色(默认 #E6E8EB ) | |
| 70 | 74 | * @property {String | Number} marginTop 上边距 (默认 10 ) |
| 71 | 75 | * @property {String | Number} marginBottom 下边距 (默认 10 ) |
| 72 | 76 | * @property {String | Number} height 高度,单位px (默认 'auto' ) |
| 73 | 77 | * @property {Boolean} line 是否显示左边分割线 (默认 false ) |
| 78 | + * @property {Boolean} dashed // 是否虚线,true-虚线,false-实线 (默认 false ) | |
| 74 | 79 | * @event {Function} loadmore status为loadmore时,点击组件会发出此事件 |
| 75 | 80 | * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" /> |
| 76 | 81 | */ | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-no-network/u-no-network.vue
yudao-ui-app/uni_modules/uview-ui/components/u-parse/node/node.vue
| ... | ... | @@ -201,7 +201,7 @@ export default { |
| 201 | 201 | // #ifdef H5 || APP-PLUS |
| 202 | 202 | node.attrs.src = node.attrs.src || node.attrs['data-src'] |
| 203 | 203 | // #endif |
| 204 | - this.root.$emit('imgtap', node.attrs) | |
| 204 | + this.root.$emit('imgTap', node.attrs) | |
| 205 | 205 | // 自动预览图片 |
| 206 | 206 | if (this.root.previewImg) |
| 207 | 207 | uni.previewImage({ |
| ... | ... | @@ -262,7 +262,7 @@ export default { |
| 262 | 262 | linkTap(e) { |
| 263 | 263 | var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e, |
| 264 | 264 | href = attrs.href |
| 265 | - this.root.$emit('linktap', attrs) | |
| 265 | + this.root.$emit('linkTap', attrs) | |
| 266 | 266 | if (href) { |
| 267 | 267 | // 跳转锚点 |
| 268 | 268 | if (href[0] == '#') |
| ... | ... | @@ -496,4 +496,4 @@ export default { |
| 496 | 496 | height: 225px; |
| 497 | 497 | } |
| 498 | 498 | /* #endif */ |
| 499 | -</style> | |
| 500 | 499 | \ No newline at end of file |
| 500 | +</style> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-picker/props.js
| ... | ... | @@ -50,11 +50,6 @@ export default { |
| 50 | 50 | type: String, |
| 51 | 51 | default: uni.$u.props.picker.confirmColor |
| 52 | 52 | }, |
| 53 | - // 选择器只有一列时,默认选中项的索引,从0开始 | |
| 54 | - singleIndex: { | |
| 55 | - type: [String, Number], | |
| 56 | - default: uni.$u.props.picker.singleIndex | |
| 57 | - }, | |
| 58 | 53 | // 每列中可见选项的数量 |
| 59 | 54 | visibleItemCount: { |
| 60 | 55 | type: [String, Number], | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-picker/u-picker.vue
| ... | ... | @@ -66,7 +66,6 @@ |
| 66 | 66 | * @property {String} confirmText 确认按钮的文字(默认 '确定' ) |
| 67 | 67 | * @property {String} cancelColor 取消按钮的颜色(默认 '#909193' ) |
| 68 | 68 | * @property {String} confirmColor 确认按钮的颜色(默认 '#3c9cff' ) |
| 69 | - * @property {Array} singleIndex 选择器只有一列时,默认选中项的索引,从0开始(默认 0 ) | |
| 70 | 69 | * @property {String | Number} visibleItemCount 每列中可见选项的数量(默认 5 ) |
| 71 | 70 | * @property {String} keyName 选项对象中,需要展示的属性键名(默认 'text' ) |
| 72 | 71 | * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器(默认 false ) |
| ... | ... | @@ -161,7 +160,7 @@ export default { |
| 161 | 160 | this.setIndexs(value) |
| 162 | 161 | |
| 163 | 162 | this.$emit('change', { |
| 164 | - // #ifndef MP-WEIXIN | |
| 163 | + // #ifndef MP-WEIXIN || MP-LARK | |
| 165 | 164 | // 微信小程序不能传递this,会因为循环引用而报错 |
| 166 | 165 | picker: this, |
| 167 | 166 | // #endif | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-radio/u-radio.vue
| ... | ... | @@ -20,15 +20,17 @@ |
| 20 | 20 | /> |
| 21 | 21 | </slot> |
| 22 | 22 | </view> |
| 23 | - <text | |
| 24 | - class="u-radio__text" | |
| 25 | - @tap.stop="labelClickHandler" | |
| 26 | - :style="{ | |
| 27 | - color: elDisabled ? elInactiveColor : elLabelColor, | |
| 28 | - fontSize: elLabelSize, | |
| 29 | - lineHeight: elLabelSize | |
| 30 | - }" | |
| 31 | - >{{label}}</text> | |
| 23 | + <slot> | |
| 24 | + <text | |
| 25 | + class="u-radio__text" | |
| 26 | + @tap.stop="labelClickHandler" | |
| 27 | + :style="{ | |
| 28 | + color: elDisabled ? elInactiveColor : elLabelColor, | |
| 29 | + fontSize: elLabelSize, | |
| 30 | + lineHeight: elLabelSize | |
| 31 | + }" | |
| 32 | + >{{label}}</text> | |
| 33 | + </slot> | |
| 32 | 34 | </view> |
| 33 | 35 | </template> |
| 34 | 36 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-rate/u-rate.vue
| ... | ... | @@ -35,7 +35,8 @@ |
| 35 | 35 | : inactiveColor |
| 36 | 36 | " |
| 37 | 37 | :custom-style="{ |
| 38 | - padding: `0 ${$u.addUnit(gutter / 2)}`, | |
| 38 | + 'padding-left': $u.addUnit(gutter / 2), | |
| 39 | + 'padding-right': $u.addUnit(gutter / 2) | |
| 39 | 40 | }" |
| 40 | 41 | :size="size" |
| 41 | 42 | ></u-icon> |
| ... | ... | @@ -63,7 +64,8 @@ |
| 63 | 64 | : inactiveColor |
| 64 | 65 | " |
| 65 | 66 | :custom-style="{ |
| 66 | - padding: `0 ${$u.addUnit(gutter / 2)}` | |
| 67 | + 'padding-left': $u.addUnit(gutter / 2), | |
| 68 | + 'padding-right': $u.addUnit(gutter / 2) | |
| 67 | 69 | }" |
| 68 | 70 | :size="size" |
| 69 | 71 | ></u-icon> | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue
| ... | ... | @@ -19,11 +19,17 @@ |
| 19 | 19 | class="u-notice__content" |
| 20 | 20 | ref="u-notice__content" |
| 21 | 21 | > |
| 22 | - <text | |
| 22 | + <view | |
| 23 | 23 | ref="u-notice__content__text" |
| 24 | 24 | class="u-notice__content__text" |
| 25 | - :style="[textStyle]" | |
| 26 | - >{{text}}</text> | |
| 25 | + :style="[animationStyle]" | |
| 26 | + > | |
| 27 | + <text | |
| 28 | + v-for="(item, index) in innerText" | |
| 29 | + :key="index" | |
| 30 | + :style="[textStyle]" | |
| 31 | + >{{item}}</text> | |
| 32 | + </view> | |
| 27 | 33 | </view> |
| 28 | 34 | <view |
| 29 | 35 | class="u-notice__right-icon" |
| ... | ... | @@ -118,11 +124,28 @@ |
| 118 | 124 | textStyle() { |
| 119 | 125 | let style = {} |
| 120 | 126 | style.color = this.color |
| 127 | + style.fontSize = uni.$u.addUnit(this.fontSize) | |
| 128 | + return style | |
| 129 | + }, | |
| 130 | + animationStyle() { | |
| 131 | + let style = {} | |
| 121 | 132 | style.animationDuration = this.animationDuration |
| 122 | 133 | style.animationPlayState = this.animationPlayState |
| 123 | - style.fontSize = uni.$u.addUnit(this.fontSize) | |
| 124 | 134 | return style |
| 125 | 135 | }, |
| 136 | + // 内部对用户传入的数据进一步分割,放到多个text标签循环,否则如果用户传入的字符串很长(100个字符以上) | |
| 137 | + // 放在一个text标签中进行滚动,在低端安卓机上,动画可能会出现抖动现象,需要分割到多个text中可解决此问题 | |
| 138 | + innerText() { | |
| 139 | + let result = [], | |
| 140 | + // 每组text标签的字符长度 | |
| 141 | + len = 20 | |
| 142 | + const textArr = this.text.split('') | |
| 143 | + for (let i = 0; i < textArr.length; i += len) { | |
| 144 | + // 对拆分的后的text进行slice分割,得到的为数组再进行join拼接为字符串 | |
| 145 | + result.push(textArr.slice(i, i + len).join('')) | |
| 146 | + } | |
| 147 | + return result | |
| 148 | + } | |
| 126 | 149 | }, |
| 127 | 150 | mounted() { |
| 128 | 151 | // #ifdef APP-PLUS |
| ... | ... | @@ -289,6 +312,7 @@ |
| 289 | 312 | white-space: nowrap; |
| 290 | 313 | animation: u-loop-animation 10s linear infinite both; |
| 291 | 314 | /* #endif */ |
| 315 | + @include flex(row); | |
| 292 | 316 | } |
| 293 | 317 | } |
| 294 | 318 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue
yudao-ui-app/uni_modules/uview-ui/components/u-swipe-action-item/u-swipe-action-item.vue
yudao-ui-app/uni_modules/uview-ui/components/u-textarea/props.js
yudao-ui-app/uni_modules/uview-ui/components/u-textarea/u-textarea.vue
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | :holdKeyboard="holdKeyboard" |
| 22 | 22 | :maxlength="maxlength" |
| 23 | 23 | :confirmType="confirmType" |
| 24 | + :ignoreCompositionEvent="ignoreCompositionEvent" | |
| 24 | 25 | @focus="onFocus" |
| 25 | 26 | @blur="onBlur" |
| 26 | 27 | @linechange="onLinechange" |
| ... | ... | @@ -68,6 +69,7 @@ import props from "./props.js"; |
| 68 | 69 | * @property {Boolean} holdKeyboard focus时,点击页面的时候不收起键盘,只微信小程序有效(默认 false ) |
| 69 | 70 | * @property {String | Number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认 140 ) |
| 70 | 71 | * @property {String} border 边框类型,surround-四周边框,none-无边框,bottom-底部边框(默认 'surround' ) |
| 72 | + * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理 | |
| 71 | 73 | * |
| 72 | 74 | * @event {Function(e)} focus 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 |
| 73 | 75 | * @event {Function(e)} blur 输入框失去焦点时触发,event.detail = {value, cursor} | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-tooltip/u-tooltip.vue
| ... | ... | @@ -17,6 +17,7 @@ |
| 17 | 17 | :selectable="false" |
| 18 | 18 | @longpress.stop="longpressHandler" |
| 19 | 19 | :style="{ |
| 20 | + color: color, | |
| 20 | 21 | backgroundColor: bgColor && showTooltip && tooltipTop !== -10000 ? bgColor : 'transparent' |
| 21 | 22 | }" |
| 22 | 23 | >{{ text }}</text> |
| ... | ... | @@ -312,7 +313,6 @@ |
| 312 | 313 | /* #endif */ |
| 313 | 314 | |
| 314 | 315 | &__text { |
| 315 | - color: $u-content-color; | |
| 316 | 316 | font-size: 14px; |
| 317 | 317 | } |
| 318 | 318 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/components/u-upload/u-upload.vue
| ... | ... | @@ -374,6 +374,7 @@ |
| 374 | 374 | $u-upload-deletable-zIndex:3 !default; |
| 375 | 375 | $u-upload-success-bottom:0 !default; |
| 376 | 376 | $u-upload-success-right:0 !default; |
| 377 | + $u-upload-success-border-style:solid !default; | |
| 377 | 378 | $u-upload-success-border-top-color:transparent !default; |
| 378 | 379 | $u-upload-success-border-left-color:transparent !default; |
| 379 | 380 | $u-upload-success-border-bottom-color: $u-success !default; |
| ... | ... | @@ -479,6 +480,7 @@ |
| 479 | 480 | // 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物,不支持css绘制三角形 |
| 480 | 481 | // 所以在nvue下使用图片,非nvue下使用css实现 |
| 481 | 482 | /* #ifndef APP-NVUE */ |
| 483 | + border-style: $u-upload-success-border-style; | |
| 482 | 484 | border-top-color: $u-upload-success-border-top-color; |
| 483 | 485 | border-left-color: $u-upload-success-border-left-color; |
| 484 | 486 | border-bottom-color: $u-upload-success-border-bottom-color; | ... | ... |
yudao-ui-app/uni_modules/uview-ui/libs/config/config.js
| 1 | -// 此版本发布于2022-04-04 | |
| 2 | -const version = '2.0.30' | |
| 1 | +// 此版本发布于2022-00-24 | |
| 2 | +const version = '2.0.34' | |
| 3 | 3 | |
| 4 | 4 | // 开发环境才提示,生产环境不会提示 |
| 5 | 5 | if (process.env.NODE_ENV === 'development') { |
| 6 | - console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;'); | |
| 6 | + console.log(`\n %c uView V${version} %c https://uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;'); | |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | export default { | ... | ... |
yudao-ui-app/uni_modules/uview-ui/libs/config/props/codeInput.js
yudao-ui-app/uni_modules/uview-ui/libs/config/props/formItem.js
yudao-ui-app/uni_modules/uview-ui/libs/config/props/loadingPage.js
yudao-ui-app/uni_modules/uview-ui/libs/config/props/loadmore.js
| ... | ... | @@ -14,6 +14,7 @@ export default { |
| 14 | 14 | bgColor: 'transparent', |
| 15 | 15 | icon: true, |
| 16 | 16 | fontSize: 14, |
| 17 | + iconSize: 17, | |
| 17 | 18 | color: '#606266', |
| 18 | 19 | loadingIcon: 'spinner', |
| 19 | 20 | loadmoreText: '加载更多', |
| ... | ... | @@ -24,6 +25,8 @@ export default { |
| 24 | 25 | marginTop: 10, |
| 25 | 26 | marginBottom: 10, |
| 26 | 27 | height: 'auto', |
| 27 | - line: false | |
| 28 | + line: false, | |
| 29 | + lineColor: '#E6E8EB', | |
| 30 | + dashed: false, | |
| 28 | 31 | } |
| 29 | 32 | } | ... | ... |
yudao-ui-app/uni_modules/uview-ui/libs/config/props/picker.js
yudao-ui-app/uni_modules/uview-ui/libs/config/props/textarea.js
yudao-ui-app/uni_modules/uview-ui/libs/function/index.js
| ... | ... | @@ -292,15 +292,15 @@ if (!String.prototype.padStart) { |
| 292 | 292 | else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { |
| 293 | 293 | date = new Date(Number(dateTime)) |
| 294 | 294 | } |
| 295 | - // 其他都认为符合 RFC 2822 规范 | |
| 296 | - else { | |
| 297 | - // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间 | |
| 298 | - date = new Date( | |
| 299 | - typeof dateTime === 'string' | |
| 300 | - ? dateTime.replace(/-/g, '/') | |
| 301 | - : dateTime | |
| 302 | - ) | |
| 303 | - } | |
| 295 | + // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间 | |
| 296 | + // 处理 '2022-07-10 01:02:03',跳过 '2022-07-10T01:02:03' | |
| 297 | + else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) { | |
| 298 | + date = new Date(dateTime.replace(/-/g, '/')) | |
| 299 | + } | |
| 300 | + // 其他都认为符合 RFC 2822 规范 | |
| 301 | + else { | |
| 302 | + date = new Date(dateTime) | |
| 303 | + } | |
| 304 | 304 | |
| 305 | 305 | const timeSource = { |
| 306 | 306 | 'y': date.getFullYear().toString(), // 年 | ... | ... |
yudao-ui-app/uni_modules/uview-ui/libs/function/test.js
yudao-ui-app/uni_modules/uview-ui/libs/mixin/mixin.js
yudao-ui-app/uni_modules/uview-ui/libs/util/route.js
| ... | ... | @@ -53,7 +53,7 @@ class Router { |
| 53 | 53 | mergeConfig.url = this.mixinParam(options, params) |
| 54 | 54 | mergeConfig.type = 'navigateTo' |
| 55 | 55 | } else { |
| 56 | - mergeConfig = uni.$u.deepClone(options, this.config) | |
| 56 | + mergeConfig = uni.$u.deepMerge(options, this.config) | |
| 57 | 57 | // 否则正常使用mergeConfig中的url和params进行拼接 |
| 58 | 58 | mergeConfig.url = this.mixinParam(options.url, options.params) |
| 59 | 59 | } | ... | ... |
yudao-ui-app/uni_modules/uview-ui/package.json
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | "id": "uview-ui", |
| 3 | 3 | "name": "uview-ui", |
| 4 | 4 | "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖", |
| 5 | - "version": "2.0.30", | |
| 5 | + "version": "2.0.34", | |
| 6 | 6 | "description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水", |
| 7 | 7 | "keywords": [ |
| 8 | 8 | "uview", |
| ... | ... | @@ -17,12 +17,8 @@ |
| 17 | 17 | "engines": { |
| 18 | 18 | "HBuilderX": "^3.1.0" |
| 19 | 19 | }, |
| 20 | - "dcloudext": { | |
| 21 | - "category": [ | |
| 22 | - "前端组件", | |
| 23 | - "通用组件" | |
| 24 | - ], | |
| 25 | - "sale": { | |
| 20 | + "dcloudext": { | |
| 21 | + "sale": { | |
| 26 | 22 | "regular": { |
| 27 | 23 | "price": "0.00" |
| 28 | 24 | }, |
| ... | ... | @@ -38,7 +34,8 @@ |
| 38 | 34 | "data": "无", |
| 39 | 35 | "permissions": "无" |
| 40 | 36 | }, |
| 41 | - "npmurl": "https://www.npmjs.com/package/uview-ui" | |
| 37 | + "npmurl": "https://www.npmjs.com/package/uview-ui", | |
| 38 | + "type": "component-vue" | |
| 42 | 39 | }, |
| 43 | 40 | "uni_modules": { |
| 44 | 41 | "dependencies": [], | ... | ... |