uView版本升级到2.0.34

This commit is contained in:
sfmind 2022-11-19 20:38:24 +08:00
parent 5934d6b029
commit fb097f7a5b
48 changed files with 485 additions and 413 deletions

View File

@ -1,73 +1,56 @@
<p align="center"> <p align="center">
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;"> <img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
</p> </p>
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3> <h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView 2.0</h3>
<h3 align="center">多平台快速开发的UI框架</h3> <h3 align="center">多平台快速开发的UI框架</h3>
[![stars](https://img.shields.io/github/stars/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0)
[![forks](https://img.shields.io/github/forks/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0)
[![issues](https://img.shields.io/github/issues/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0/issues)
[![Website](https://img.shields.io/badge/uView-up-blue?style=flat-square)](https://uviewui.com)
[![release](https://img.shields.io/github/v/release/umicro/uView2.0?style=flat-square)](https://gitee.com/umicro/uView2.0/releases)
[![license](https://img.shields.io/github/license/umicro/uView2.0?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
## 说明 ## 说明
uView UI是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架全面的组件和便捷的工具会让您信手拈来如鱼得水 uView UI是[uni-app](https://uniapp.dcloud.io/)全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
## 特性 ## [官方文档https://uviewui.com](https://uviewui.com)
- 兼容安卓iOS微信小程序H5QQ小程序百度小程序支付宝小程序头条小程序
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
- 众多贴心的JS利器让您飞镖在手召之即来百步穿杨
- 众多的常用页面和布局,让您专注逻辑,事半功倍
- 详尽的文档支持,现代化的演示效果
- 按需引入,精简打包体积
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<br>
<br>
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
## 链接
- [官方文档](https://www.uviewui.com/)
- [更新日志](https://www.uviewui.com/components/changelog.html)
- [升级指南](https://www.uviewui.com/components/changeGuide.html)
- [关于我们](https://www.uviewui.com/cooperation/about.html)
## 交流反馈
欢迎加入我们的QQ群交流反馈[点此跳转](https://www.uviewui.com/components/addQQGroup.html)
## 关于PR
> 我们非常乐意接受各位的优质PR但在此之前我希望您了解uView2.0是一个需要兼容多个平台的小程序、h5、ios app、android app包括nvue页面、vue页面。
> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢
## 安装 ## 安装
```bash #### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593)
# npm方式安装插件市场导入无需执行此命令
npm i uview-ui 请通过[官网安装文档](https://www.uviewui.com/components/install.html)了解更详细的内容
```
## 快速上手 ## 快速上手
1. `main.js`引入uView库 请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
```js
// main.js
import uView from 'uview-ui';
Vue.use(uView);
```
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
```css
/* App.vue */
<style lang="scss">
@import "uview-ui/index.scss";
</style>
```
3. `uni.scss`引入全局scss变量文件
```css
/* uni.scss */
@import "uview-ui/theme.scss";
```
4. `pages.json`配置easycom规则(按需引入)
```js
// pages.json
{
"easycom": {
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
// npm安装方式
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// 下载安装方式
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// 此为本身已有的内容
"pages": [
// ......
]
}
```
请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容
## 使用方法 ## 使用方法
配置easycom规则后自动按需引入无需`import`组件,直接引用即可。 配置easycom规则后自动按需引入无需`import`组件,直接引用即可。
@ -78,27 +61,6 @@ Vue.use(uView);
</template> </template>
``` ```
请通过[快速上手](https://www.uviewui.com/components/quickstart.html)了解更详细的内容
## 链接
- [官方文档](https://www.uviewui.com/)
- [更新日志](https://www.www.uviewui.com/components/changelog.html)
- [升级指南](https://www.uviewui.com/components/changelog.html)
- [关于我们](https://www.uviewui.com/cooperation/about.html)
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<br>
<br>
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
## 捐赠uView的研发
uView文档和源码全部开源免费如果您认为uView帮到了您的开发工作您可以捐赠uView的研发工作捐赠无门槛哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
<img src="https://uviewui.com/common/alipay.png" width="220" ><img style="margin-left: 100px;" src="https://uviewui.com/common/wechat.png" width="220" >
## 版权信息 ## 版权信息
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议意味着您无需支付任何费用也无需授权即可将uView应用到您的产品中。 uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议意味着您无需支付任何费用也无需授权即可将uView应用到您的产品中。

View File

@ -1,3 +1,42 @@
## 2.0.342022-09-25
# uView2.0重磅发布,利剑出鞘,一统江湖
1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性
2. 修复`route`方法调用可能报错的问题
3. 修复`u-no-network`组件`z-index`无效的问题
4. 修复`textarea`组件在h5上confirmType=""报错的问题
5. `u-rate`适配`nvue`
6. 优化验证手机号码的正则表达式(根据工信部发布的《电信网编号计划2017年版》进行修改。)
7. `form-item`添加`labelPosition`属性
8. `u-calendar`修复`maxDate`设置为当前日期并且当前时间大于0800时无法显示日期列表的问题 (#724)
9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680)
10. 修复`timeFormat`函数在safari重的兼容性问题 (#664)
## 2.0.332022-06-17
# uView2.0重磅发布,利剑出鞘,一统江湖
1. 修复`loadmore`组件`lineColor`类型错误问题
2. 修复`u-parse`组件`imgtap`、`linktap`不生效问题
## 2.0.322022-06-16
# uView2.0重磅发布,利剑出鞘,一统江湖
1. `u-loadmore`新增自定义颜色、虚/实线
2. 修复`u-swiper-action`组件部分平台不能上下滑动的问题
3. 修复`u-list`回弹问题
4. 修复`notice-bar`组件动画在低端安卓机可能会抖动的问题
5. `u-loading-page`添加控制图标大小的属性`iconSize`
6. 修复`u-tooltip`组件`color`参数不生效的问题
7. 修复`u--input`组件使用`blur`事件输出为`undefined`的bug
8. `u-code-input`组件新增键盘弹起时,是否自动上推页面参数`adjustPosition`
9. 修复`image`组件`load`事件无回调对象问题
10. 修复`button`组件`loadingSize`设置无效问题
10. 其他修复
## 2.0.312022-04-19
# uView2.0重磅发布,利剑出鞘,一统江湖
1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题
2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题
3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能)
4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题
5. 其他修复
## 2.0.302022-04-04 ## 2.0.302022-04-04
# uView2.0重磅发布,利剑出鞘,一统江湖 # uView2.0重磅发布,利剑出鞘,一统江湖

View File

@ -35,8 +35,9 @@
:shape="shape" :shape="shape"
:customStyle="customStyle" :customStyle="customStyle"
:formatter="formatter" :formatter="formatter"
:ignoreCompositionEvent="ignoreCompositionEvent"
@focus="$emit('focus')" @focus="$emit('focus')"
@blur="$emit('blur')" @blur="e => $emit('blur', e)"
@keyboardheightchange="$emit('keyboardheightchange')" @keyboardheightchange="$emit('keyboardheightchange')"
@change="e => $emit('change', e)" @change="e => $emit('change', e)"
@input="e => $emit('input', e)" @input="e => $emit('input', e)"

View File

@ -21,6 +21,7 @@
:border="border" :border="border"
:customStyle="customStyle" :customStyle="customStyle"
:formatter="formatter" :formatter="formatter"
:ignoreCompositionEvent="ignoreCompositionEvent"
@focus="e => $emit('focus')" @focus="e => $emit('focus')"
@blur="e => $emit('blur')" @blur="e => $emit('blur')"
@linechange="e => $emit('linechange', e)" @linechange="e => $emit('linechange', e)"

View File

@ -15,7 +15,7 @@
<text class="u-action-sheet__header__title u-line-1">{{title}}</text> <text class="u-action-sheet__header__title u-line-1">{{title}}</text>
<view <view
class="u-action-sheet__header__icon-wrap" class="u-action-sheet__header__icon-wrap"
@tap.stop="close" @tap.stop="cancel"
> >
<u-icon <u-icon
name="close" name="close"

View File

@ -28,7 +28,7 @@
<template v-if="loading"> <template v-if="loading">
<u-loading-icon <u-loading-icon
:mode="loadingMode" :mode="loadingMode"
:size="textSize * 1.15" :size="loadingSize * 1.15"
:color="loadingColor" :color="loadingColor"
></u-loading-icon> ></u-loading-icon>
<text <text
@ -75,7 +75,7 @@
<template v-if="loading"> <template v-if="loading">
<u-loading-icon <u-loading-icon
:mode="loadingMode" :mode="loadingMode"
:size="textSize * 1.15" :size="loadingSize * 1.15"
:color="loadingColor" :color="loadingColor"
></u-loading-icon> ></u-loading-icon>
<text <text

View File

@ -209,12 +209,13 @@ export default {
} }
}, },
init() { init() {
// maxDate // maxDateminDate
if ( if (
this.innerMaxDate && this.innerMaxDate &&
new Date(this.innerMaxDate).getTime() <= Date.now() this.innerMinDate &&
new Date(this.innerMaxDate).getTime() < new Date(this.innerMinDate).getTime()
) { ) {
return uni.$u.error('maxDate不能小于当前时间') return uni.$u.error('maxDate不能小于minDate')
} }
// //
this.listHeight = this.rowHeight * 5 + 30 this.listHeight = this.rowHeight * 5 + 30

View File

@ -1,5 +1,10 @@
export default { export default {
props: { props: {
// 键盘弹起时,是否自动上推页面
adjustPosition: {
type: Boolean,
default: uni.$u.props.codeInput.adjustPosition
},
// 最大输入长度 // 最大输入长度
maxlength: { maxlength: {
type: [String, Number], type: [String, Number],

View File

@ -23,7 +23,9 @@
v-if="mode === 'line'" v-if="mode === 'line'"
:style="[lineStyle]" :style="[lineStyle]"
></view> ></view>
<view v-if="codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view> <!-- #ifndef APP-PLUS -->
<view v-if="isFocus && codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
<!-- #endif -->
</view> </view>
<input <input
:disabled="disabledKeyboard" :disabled="disabledKeyboard"
@ -31,11 +33,14 @@
:focus="focus" :focus="focus"
:value="inputValue" :value="inputValue"
:maxlength="maxlength" :maxlength="maxlength"
:adjustPosition="adjustPosition"
class="u-code-input__input" class="u-code-input__input"
@input="inputHandler" @input="inputHandler"
:style="{ :style="{
height: $u.addUnit(size) height: $u.addUnit(size)
}" }"
@focus="isFocus = true"
@blur="isFocus = false"
/> />
</view> </view>
</template> </template>
@ -70,7 +75,8 @@
mixins: [uni.$u.mpMixin, uni.$u.mixin, props], mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() { data() {
return { return {
inputValue: '' inputValue: '',
isFocus: this.focus
} }
}, },
watch: { watch: {
@ -203,6 +209,7 @@
width: 40px; width: 40px;
background-color: $u-content-color; background-color: $u-content-color;
} }
/* #ifndef APP-PLUS */
&__cursor { &__cursor {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -212,6 +219,8 @@
height: $u-code-input-cursor-height; height: $u-code-input-cursor-height;
animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite; animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite;
} }
/* #endif */
} }
&__input { &__input {
@ -226,6 +235,7 @@
} }
} }
/* #ifndef APP-PLUS */
@keyframes u-cursor-flicker { @keyframes u-cursor-flicker {
0% { 0% {
opacity: 0; opacity: 0;
@ -237,4 +247,6 @@
opacity: 0; opacity: 0;
} }
} }
/* #endif */
</style> </style>

View File

@ -16,11 +16,11 @@
* @property {String} endText 倒计结束的提示语见官网说明默认 '重新获取' * @property {String} endText 倒计结束的提示语见官网说明默认 '重新获取'
* @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时 默认false * @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时 默认false
* @property {String} uniqueKey 为了区分多个页面或者一个页面多个倒计时组件本地存储的继续倒计时变了 * @property {String} uniqueKey 为了区分多个页面或者一个页面多个倒计时组件本地存储的继续倒计时变了
* *
* @event {Function} change 倒计时期间每秒触发一次 * @event {Function} change 倒计时期间每秒触发一次
* @event {Function} start 开始倒计时触发 * @event {Function} start 开始倒计时触发
* @event {Function} end 结束倒计时触发 * @event {Function} end 结束倒计时触发
* @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code> * @example <u-code ref="uCode" @change="codeChange" seconds="20"></u-code>
*/ */
export default { export default {
name: "u-code", name: "u-code",
@ -74,7 +74,6 @@
this.canGetCode = false this.canGetCode = false
// setInterval1 // setInterval1
this.changeEvent(this.changeText.replace(/x|X/, this.secNum)) this.changeEvent(this.changeText.replace(/x|X/, this.secNum))
this.setTimeToStorage()
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (--this.secNum) { if (--this.secNum) {
// "x" // "x"
@ -88,7 +87,8 @@
this.canGetCode = true this.canGetCode = true
} }
}, 1000) }, 1000)
}, this.setTimeToStorage()
},
// //
reset() { reset() {
this.canGetCode = true this.canGetCode = true

View File

@ -1,146 +1,127 @@
<template> <template>
<view class="u-drawdown-item"> <view class="u-drawdown">
<u-overlay <view
customStyle="top: 126px" class="u-dropdown__menu"
:show="show" :style="{
:closeOnClickOverlay="closeOnClickOverlay" height: $u.addUnit(height)
@click="overlayClick" }"
></u-overlay> ref="u-dropdown__menu"
<view >
class="u-drawdown-item__content" <view
:style="[style]" class="u-dropdown__menu__item"
:animation="animationData" v-for="(item, index) in menuList"
ref="animation" :key="index"
> @tap.stop="clickHandler(item, index)"
<slot /> >
</view> <view class="u-dropdown__menu__item__content">
</view> <text
class="u-dropdown__menu__item__content__text"
:style="[index === current ? activeStyle : inactiveStyle]"
>{{item.title}}</text>
<view
class="u-dropdown__menu__item__content__arrow"
:class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
>
<u-icon
:name="menuIcon"
:size="$u.addUnit(menuIconSize)"
></u-icon>
</view>
</view>
</view>
</view>
<view class="u-dropdown__content">
<slot />
</view>
</view>
</template> </template>
<script> <script>
// #ifdef APP-NVUE import props from './props.js';
const animation = uni.requireNativePlugin('animation') /**
const dom = uni.requireNativePlugin('dom') * Dropdown
// #endif * @description
import props from './props.js'; * @tutorial url
/** * @property {String}
* Drawdownitem * @event {Function}
* @description * @example
* @tutorial url */
* @property {String} export default {
* @event {Function} name: 'u-dropdown',
* @example mixins: [uni.$u.mixin, props],
*/ data() {
export default { return {
name: 'u-drawdown-item', // <EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mixins: [uni.$u.mpMixin, uni.$u.mixin, props], menuList: [],
data() { current: 0
return { }
show: false, },
top: '126px', computed: {
// uni.createAnimation
animationData: {}, },
} created() {
}, // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(u-dropdown-item)<EFBFBD><EFBFBD>this<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>data<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>΢<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mounted() { this.children = [];
this.init() },
}, methods: {
watch: { clickHandler(item, index) {
// this.children.map(child => {
dataChange(newValue, oldValue) { if(child.title === item.title) {
this.updateParentData() // this.queryRect('u-dropdown__menu').then(size => {
} child.$emit('click')
}, child.setContentAnimate(child.show ? 0 : 300)
computed: { child.show = !child.show
// // })
dataChange() { } else {
return [this.title, this.disabled] child.show = false
}, child.setContentAnimate(0)
style() { }
const style = { })
zIndex: 10071, },
position: 'fixed', // <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǩ<EFBFBD>ijߴ<EFBFBD>λ<EFBFBD><EFBFBD>
display: 'flex', queryRect(el) {
left: 0, // #ifndef APP-NVUE
right: 0 // $uGetRectΪuView<EFBFBD>Դ<EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD>ѯ<EFBFBD>򻯷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>https://www.uviewui.com/js/getRect.html
} // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>this.$uGetRect<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊthis.$u.getRect<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>£<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD>ͬ
style.top = uni.$u.addUnit(this.top) return new Promise(resolve => {
return style this.$uGetRect(`.${el}`).then(size => {
} resolve(size)
}, })
methods: { })
init() { // #endif
this.updateParentData()
}, // #ifdef APP-NVUE
// // nvue<EFBFBD>£<EFBFBD>ʹ<EFBFBD><EFBFBD>domģ<EFBFBD><EFBFBD><EFBFBD>ѯԪ<EFBFBD>ظ߶<EFBFBD>
updateParentData() { // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>promise<EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD>ô˷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>then<EFBFBD>ص<EFBFBD>
// u-dropdown return new Promise(resolve => {
this.getParentData('u-dropdown') dom.getComponentRect(this.$refs[el], res => {
if (!this.parent) uni.$u.error('u-dropdown-item必须配合u-dropdown使用') resolve(res.size)
// menuList })
const menuIndex = this.parent.menuList.findIndex(item => item.title === this.title) })
const menuContent = { // #endif
title: this.title, },
disabled: this.disabled },
} }
if (menuIndex >= 0) {
//
this.parent.menuList[menuIndex] = menuContent;
} else {
// push
this.parent.menuList.push(menuContent);
}
},
async setContentAnimate(height) {
this.animating = true
// #ifdef APP-NVUE
const ref = this.$refs['animation'].ref
animation.transition(ref, {
styles: {
height: uni.$u.addUnit(height)
},
duration: this.duration,
timingFunction: 'ease-in-out',
}, () => {
this.animating = false
})
// #endif
// #ifndef APP-NVUE
const animation = uni.createAnimation({
timingFunction: 'ease-in-out',
});
animation
.height(height)
.step({
duration: this.duration,
})
.step()
// animationData
this.animationData = animation.export()
//
uni.$u.sleep(this.duration).then(() => {
this.animating = false
})
// #endif
},
overlayClick() {
this.show = false
this.setContentAnimate(0)
}
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss">
@import '../../libs/css/components.scss'; @import '../../libs/css/components.scss';
.u-drawdown-item { .u-dropdown {
&__content { &__menu {
background-color: #FFFFFF; @include flex;
overflow: hidden;
height: 0; &__item {
} flex: 1;
} @include flex;
justify-content: center;
&__content {
@include flex;
align-items: center;
}
}
}
}
</style> </style>

View File

@ -1,127 +1,127 @@
<template> <template>
<view class="u-drawdown"> <view class="u-drawdown">
<view <view
class="u-dropdown__menu" class="u-dropdown__menu"
:style="{ :style="{
height: $u.addUnit(height) height: $u.addUnit(height)
}" }"
ref="u-dropdown__menu" ref="u-dropdown__menu"
> >
<view <view
class="u-dropdown__menu__item" class="u-dropdown__menu__item"
v-for="(item, index) in menuList" v-for="(item, index) in menuList"
:key="index" :key="index"
@tap.stop="clickHandler(item, index)" @tap.stop="clickHandler(item, index)"
> >
<view class="u-dropdown__menu__item__content"> <view class="u-dropdown__menu__item__content">
<text <text
class="u-dropdown__menu__item__content__text" class="u-dropdown__menu__item__content__text"
:style="[index === current ? activeStyle : inactiveStyle]" :style="[index === current ? activeStyle : inactiveStyle]"
>{{item.title}}</text> >{{item.title}}</text>
<view <view
class="u-dropdown__menu__item__content__arrow" class="u-dropdown__menu__item__content__arrow"
:class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']" :class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
> >
<u-icon <u-icon
:name="menuIcon" :name="menuIcon"
:size="$u.addUnit(menuIconSize)" :size="$u.addUnit(menuIconSize)"
></u-icon> ></u-icon>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="u-dropdown__content"> <view class="u-dropdown__content">
<slot /> <slot />
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import props from './props.js'; import props from './props.js';
/** /**
* Dropdown * Dropdown
* @description * @description
* @tutorial url * @tutorial url
* @property {String} * @property {String}
* @event {Function} * @event {Function}
* @example * @example
*/ */
export default { export default {
name: 'u-dropdown', name: 'u-dropdown',
mixins: [uni.$u.mixin, props], mixins: [uni.$u.mixin, props],
data() { data() {
return { return {
// // <EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menuList: [], menuList: [],
current: 0 current: 0
} }
}, },
computed: { computed: {
}, },
created() { created() {
// (u-dropdown-item)thisdata // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(u-dropdown-item)<EFBFBD><EFBFBD>this<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>data<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>΢<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
this.children = []; this.children = [];
}, },
methods: { methods: {
clickHandler(item, index) { clickHandler(item, index) {
this.children.map(child => { this.children.map(child => {
if(child.title === item.title) { if(child.title === item.title) {
// this.queryRect('u-dropdown__menu').then(size => { // this.queryRect('u-dropdown__menu').then(size => {
child.$emit('click') child.$emit('click')
child.setContentAnimate(child.show ? 0 : 300) child.setContentAnimate(child.show ? 0 : 300)
child.show = !child.show child.show = !child.show
// }) // })
} else { } else {
child.show = false child.show = false
child.setContentAnimate(0) child.setContentAnimate(0)
} }
}) })
}, },
// // <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǩ<EFBFBD>ijߴ<EFBFBD>λ<EFBFBD><EFBFBD>
queryRect(el) { queryRect(el) {
// #ifndef APP-NVUE // #ifndef APP-NVUE
// $uGetRectuViewhttps://www.uviewui.com/js/getRect.html // $uGetRectΪuView<EFBFBD>Դ<EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD>ѯ<EFBFBD>򻯷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>https://www.uviewui.com/js/getRect.html
// this.$uGetRectthis.$u.getRect // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>this.$uGetRect<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊthis.$u.getRect<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>£<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD>ͬ
return new Promise(resolve => { return new Promise(resolve => {
this.$uGetRect(`.${el}`).then(size => { this.$uGetRect(`.${el}`).then(size => {
resolve(size) resolve(size)
}) })
}) })
// #endif // #endif
// #ifdef APP-NVUE // #ifdef APP-NVUE
// nvue使dom // nvue<EFBFBD>£<EFBFBD>ʹ<EFBFBD><EFBFBD>domģ<EFBFBD><EFBFBD><EFBFBD>ѯԪ<EFBFBD>ظ߶<EFBFBD>
// promise使then // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>promise<EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD>ô˷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>then<EFBFBD>ص<EFBFBD>
return new Promise(resolve => { return new Promise(resolve => {
dom.getComponentRect(this.$refs[el], res => { dom.getComponentRect(this.$refs[el], res => {
resolve(res.size) resolve(res.size)
}) })
}) })
// #endif // #endif
}, },
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '../../libs/css/components.scss'; @import '../../libs/css/components.scss';
.u-dropdown { .u-dropdown {
&__menu { &__menu {
@include flex; @include flex;
&__item { &__item {
flex: 1; flex: 1;
@include flex; @include flex;
justify-content: center; justify-content: center;
&__content { &__content {
@include flex; @include flex;
align-items: center; align-items: center;
} }
} }
} }
} }
</style> </style>

View File

@ -15,6 +15,11 @@ export default {
type: [String, Boolean], type: [String, Boolean],
default: uni.$u.props.formItem.borderBottom default: uni.$u.props.formItem.borderBottom
}, },
// label的位置left-左边top-上边
labelPosition: {
type: String,
default: uni.$u.props.formItem.labelPosition
},
// label的宽度单位px // label的宽度单位px
labelWidth: { labelWidth: {
type: [String, Number], type: [String, Number],

View File

@ -4,7 +4,7 @@
class="u-form-item__body" class="u-form-item__body"
@tap="clickHandler" @tap="clickHandler"
:style="[$u.addStyle(customStyle), { :style="[$u.addStyle(customStyle), {
flexDirection: parentData.labelPosition === 'left' ? 'row' : 'column' flexDirection: (labelPosition || parentData.labelPosition) === 'left' ? 'row' : 'column'
}]" }]"
> >
<!-- 微信小程序中将一个参数设置空字符串结果会变成字符串"true" --> <!-- 微信小程序中将一个参数设置空字符串结果会变成字符串"true" -->

View File

@ -161,10 +161,10 @@
this.$emit('error', err) this.$emit('error', err)
}, },
// loading // loading
onLoadHandler() { onLoadHandler(event) {
this.loading = false this.loading = false
this.isError = false this.isError = false
this.$emit('load') this.$emit('load', event)
this.removeBgColor() this.removeBgColor()
// //
// fadepng // fadepng

View File

@ -177,6 +177,11 @@ export default {
formatter: { formatter: {
type: [Function, null], type: [Function, null],
default: uni.$u.props.input.formatter default: uni.$u.props.input.formatter
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
} }
} }
} }

View File

@ -38,6 +38,7 @@
:selection-end="selectionEnd" :selection-end="selectionEnd"
:selection-start="selectionStart" :selection-start="selectionStart"
:password="password || type === 'password' || undefined" :password="password || type === 'password' || undefined"
:ignoreCompositionEvent="ignoreCompositionEvent"
@input="onInput" @input="onInput"
@blur="onBlur" @blur="onBlur"
@focus="onFocus" @focus="onFocus"
@ -114,7 +115,7 @@ import props from "./props.js";
* @property {Boolean} readonly 是否只读与disabled不同之处在于disabled会置灰组件而readonly则不会 默认 false * @property {Boolean} readonly 是否只读与disabled不同之处在于disabled会置灰组件而readonly则不会 默认 false
* @property {String} shape 输入框形状circle-圆形square-方形 默认 'square' * @property {String} shape 输入框形状circle-圆形square-方形 默认 'square'
* @property {Object} customStyle 定义需要用到的外部样式 * @property {Object} customStyle 定义需要用到的外部样式
* * @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理
* @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" /> * @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" />
*/ */
export default { export default {

View File

@ -24,7 +24,7 @@ export default {
type: [String, Number], type: [String, Number],
default: uni.$u.props.line.margin default: uni.$u.props.line.margin
}, },
// 是否虚线true-实线false-虚线 // 是否虚线true-虚线false-实线
dashed: { dashed: {
type: Boolean, type: Boolean,
default: uni.$u.props.line.dashed default: uni.$u.props.line.dashed

View File

@ -29,9 +29,7 @@
@scrolltolower="scrolltolower" @scrolltolower="scrolltolower"
@scrolltoupper="scrolltoupper" @scrolltoupper="scrolltoupper"
> >
<view :style="{ <view>
paddingTop: `${offset}px`
}">
<slot /> <slot />
</view> </view>
</scroll-view> </scroll-view>

View File

@ -35,6 +35,11 @@ export default {
type: [String, Number], type: [String, Number],
default: uni.$u.props.loadingPage.fontSize default: uni.$u.props.loadingPage.fontSize
}, },
// 图标大小
iconSize: {
type: [String, Number],
default: uni.$u.props.loadingPage.fontSize
},
// 加载中图标的颜色只能rgb或者十六进制颜色值 // 加载中图标的颜色只能rgb或者十六进制颜色值
loadingColor: { loadingColor: {
type: String, type: String,

View File

@ -19,11 +19,15 @@
:src="image" :src="image"
class="u-loading-page__warpper__loading-icon__img" class="u-loading-page__warpper__loading-icon__img"
mode="widthFit" mode="widthFit"
:style="{
width: $u.addUnit(iconSize),
height: $u.addUnit(iconSize)
}"
></image> ></image>
<u-loading-icon <u-loading-icon
v-else v-else
:mode="loadingMode" :mode="loadingMode"
size="28" :size="$u.addUnit(iconSize)"
:color="loadingColor" :color="loadingColor"
></u-loading-icon> ></u-loading-icon>
</view> </view>
@ -55,6 +59,7 @@ import props from "./props.js";
* @property {String} bgColor 背景色 默认 '#ffffff' * @property {String} bgColor 背景色 默认 '#ffffff'
* @property {String} color 文字颜色 默认 '#C8C8C8' * @property {String} color 文字颜色 默认 '#C8C8C8'
* @property {String | Number} fontSize 文字大小 默认 19 * @property {String | Number} fontSize 文字大小 默认 19
* @property {String | Number} iconSize 图标大小 默认 28
* @property {String} loadingColor 加载中图标的颜色只能rgb或者十六进制颜色值 默认 '#C8C8C8' * @property {String} loadingColor 加载中图标的颜色只能rgb或者十六进制颜色值 默认 '#C8C8C8'
* @property {Object} customStyle 自定义样式 * @property {Object} customStyle 自定义样式
* @example <u-loading mode="circle"></u-loading> * @example <u-loading mode="circle"></u-loading>

View File

@ -19,13 +19,17 @@ export default {
fontSize: { fontSize: {
type: [String, Number], type: [String, Number],
default: uni.$u.props.loadmore.fontSize default: uni.$u.props.loadmore.fontSize
},
// 图标大小
iconSize: {
type: [String, Number],
default: uni.$u.props.loadmore.iconSize
}, },
// 字体颜色 // 字体颜色
color: { color: {
type: String, type: String,
default: uni.$u.props.loadmore.color default: uni.$u.props.loadmore.color
}, },
// 加载中状态的图标spinner-花朵状图标circle-圆圈状semicircle-半圆 // 加载中状态的图标spinner-花朵状图标circle-圆圈状semicircle-半圆
loadingIcon: { loadingIcon: {
type: String, type: String,
@ -75,6 +79,16 @@ export default {
line: { line: {
type: Boolean, type: Boolean,
default: uni.$u.props.loadmore.line default: uni.$u.props.loadmore.line
},
// 线条颜色
lineColor: {
type: String,
default: uni.$u.props.loadmore.lineColor
},
// 是否虚线true-虚线false-实线
dashed: {
type: Boolean,
default: uni.$u.props.loadmore.dashed
} }
} }
} }

View File

@ -13,8 +13,9 @@
> >
<u-line <u-line
length="140rpx" length="140rpx"
color="#E6E8EB" :color="lineColor"
:hairline="false" :hairline="false"
:dashed="dashed"
v-if="line" v-if="line"
></u-line> ></u-line>
<!-- 加载中和没有更多的状态才显示两边的横线 --> <!-- 加载中和没有更多的状态才显示两边的横线 -->
@ -28,7 +29,7 @@
> >
<u-loading-icon <u-loading-icon
:color="iconColor" :color="iconColor"
size="17" :size="iconSize"
:mode="loadingIcon" :mode="loadingIcon"
></u-loading-icon> ></u-loading-icon>
</view> </view>
@ -42,8 +43,9 @@
</view> </view>
<u-line <u-line
length="140rpx" length="140rpx"
color="#E6E8EB" :color="lineColor"
:hairline="false" :hairline="false"
:dashed="dashed"
v-if="line" v-if="line"
></u-line> ></u-line>
</view> </view>
@ -60,6 +62,7 @@
* @property {String} bgColor 组件背景颜色在页面是非白色时会用到默认 'transparent' * @property {String} bgColor 组件背景颜色在页面是非白色时会用到默认 'transparent'
* @property {Boolean} icon 加载中时是否显示图标默认 true * @property {Boolean} icon 加载中时是否显示图标默认 true
* @property {String | Number} fontSize 字体大小默认 14 * @property {String | Number} fontSize 字体大小默认 14
* @property {String | Number} iconSize 图标大小默认 17
* @property {String} color 字体颜色默认 '#606266' * @property {String} color 字体颜色默认 '#606266'
* @property {String} loadingIcon 加载图标默认 'circle' * @property {String} loadingIcon 加载图标默认 'circle'
* @property {String} loadmoreText 加载前的提示语默认 '加载更多' * @property {String} loadmoreText 加载前的提示语默认 '加载更多'
@ -67,10 +70,12 @@
* @property {String} nomoreText 没有更多的提示语默认 '没有更多了' * @property {String} nomoreText 没有更多的提示语默认 '没有更多了'
* @property {Boolean} isDot 到上一个相邻元素的距离 默认 false * @property {Boolean} isDot 到上一个相邻元素的距离 默认 false
* @property {String} iconColor 加载中图标的颜色 默认 '#b7b7b7' * @property {String} iconColor 加载中图标的颜色 默认 '#b7b7b7'
* @property {String} lineColor 线条颜色默认 #E6E8EB
* @property {String | Number} marginTop 上边距 默认 10 * @property {String | Number} marginTop 上边距 默认 10
* @property {String | Number} marginBottom 下边距 默认 10 * @property {String | Number} marginBottom 下边距 默认 10
* @property {String | Number} height 高度单位px 默认 'auto' * @property {String | Number} height 高度单位px 默认 'auto'
* @property {Boolean} line 是否显示左边分割线 默认 false * @property {Boolean} line 是否显示左边分割线 默认 false
* @property {Boolean} dashed // 线true-线false-线 false
* @event {Function} loadmore status为loadmore时点击组件会发出此事件 * @event {Function} loadmore status为loadmore时点击组件会发出此事件
* @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" /> * @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
*/ */

View File

@ -1,6 +1,7 @@
<template> <template>
<u-overlay <u-overlay
:show="!isConnected" :show="!isConnected"
:zIndex="zIndex"
@touchmove.stop.prevent="noop" @touchmove.stop.prevent="noop"
:customStyle="{ :customStyle="{
backgroundColor: '#fff', backgroundColor: '#fff',

View File

@ -201,7 +201,7 @@ export default {
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
node.attrs.src = node.attrs.src || node.attrs['data-src'] node.attrs.src = node.attrs.src || node.attrs['data-src']
// #endif // #endif
this.root.$emit('imgtap', node.attrs) this.root.$emit('imgTap', node.attrs)
// //
if (this.root.previewImg) if (this.root.previewImg)
uni.previewImage({ uni.previewImage({
@ -262,7 +262,7 @@ export default {
linkTap(e) { linkTap(e) {
var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e, var attrs = e.currentTarget ? this.childs[e.currentTarget.dataset.i].attrs : e,
href = attrs.href href = attrs.href
this.root.$emit('linktap', attrs) this.root.$emit('linkTap', attrs)
if (href) { if (href) {
// //
if (href[0] == '#') if (href[0] == '#')
@ -496,4 +496,4 @@ export default {
height: 225px; height: 225px;
} }
/* #endif */ /* #endif */
</style> </style>

View File

@ -50,11 +50,6 @@ export default {
type: String, type: String,
default: uni.$u.props.picker.confirmColor default: uni.$u.props.picker.confirmColor
}, },
// 选择器只有一列时默认选中项的索引从0开始
singleIndex: {
type: [String, Number],
default: uni.$u.props.picker.singleIndex
},
// 每列中可见选项的数量 // 每列中可见选项的数量
visibleItemCount: { visibleItemCount: {
type: [String, Number], type: [String, Number],

View File

@ -66,7 +66,6 @@
* @property {String} confirmText 确认按钮的文字默认 '确定' * @property {String} confirmText 确认按钮的文字默认 '确定'
* @property {String} cancelColor 取消按钮的颜色默认 '#909193' * @property {String} cancelColor 取消按钮的颜色默认 '#909193'
* @property {String} confirmColor 确认按钮的颜色默认 '#3c9cff' * @property {String} confirmColor 确认按钮的颜色默认 '#3c9cff'
* @property {Array} singleIndex 选择器只有一列时默认选中项的索引从0开始默认 0
* @property {String | Number} visibleItemCount 每列中可见选项的数量默认 5 * @property {String | Number} visibleItemCount 每列中可见选项的数量默认 5
* @property {String} keyName 选项对象中需要展示的属性键名默认 'text' * @property {String} keyName 选项对象中需要展示的属性键名默认 'text'
* @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器默认 false * @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器默认 false
@ -161,7 +160,7 @@ export default {
this.setIndexs(value) this.setIndexs(value)
this.$emit('change', { this.$emit('change', {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-LARK
// this // this
picker: this, picker: this,
// #endif // #endif

View File

@ -20,15 +20,17 @@
/> />
</slot> </slot>
</view> </view>
<text <slot>
class="u-radio__text" <text
@tap.stop="labelClickHandler" class="u-radio__text"
:style="{ @tap.stop="labelClickHandler"
color: elDisabled ? elInactiveColor : elLabelColor, :style="{
fontSize: elLabelSize, color: elDisabled ? elInactiveColor : elLabelColor,
lineHeight: elLabelSize fontSize: elLabelSize,
}" lineHeight: elLabelSize
>{{label}}</text> }"
>{{label}}</text>
</slot>
</view> </view>
</template> </template>

View File

@ -35,7 +35,8 @@
: inactiveColor : inactiveColor
" "
:custom-style="{ :custom-style="{
padding: `0 ${$u.addUnit(gutter / 2)}`, 'padding-left': $u.addUnit(gutter / 2),
'padding-right': $u.addUnit(gutter / 2)
}" }"
:size="size" :size="size"
></u-icon> ></u-icon>
@ -63,7 +64,8 @@
: inactiveColor : inactiveColor
" "
:custom-style="{ :custom-style="{
padding: `0 ${$u.addUnit(gutter / 2)}` 'padding-left': $u.addUnit(gutter / 2),
'padding-right': $u.addUnit(gutter / 2)
}" }"
:size="size" :size="size"
></u-icon> ></u-icon>

View File

@ -19,11 +19,17 @@
class="u-notice__content" class="u-notice__content"
ref="u-notice__content" ref="u-notice__content"
> >
<text <view
ref="u-notice__content__text" ref="u-notice__content__text"
class="u-notice__content__text" class="u-notice__content__text"
:style="[textStyle]" :style="[animationStyle]"
>{{text}}</text> >
<text
v-for="(item, index) in innerText"
:key="index"
:style="[textStyle]"
>{{item}}</text>
</view>
</view> </view>
<view <view
class="u-notice__right-icon" class="u-notice__right-icon"
@ -118,11 +124,28 @@
textStyle() { textStyle() {
let style = {} let style = {}
style.color = this.color style.color = this.color
style.animationDuration = this.animationDuration
style.animationPlayState = this.animationPlayState
style.fontSize = uni.$u.addUnit(this.fontSize) style.fontSize = uni.$u.addUnit(this.fontSize)
return style return style
}, },
animationStyle() {
let style = {}
style.animationDuration = this.animationDuration
style.animationPlayState = this.animationPlayState
return style
},
// text100
// texttext
innerText() {
let result = [],
// text
len = 20
const textArr = this.text.split('')
for (let i = 0; i < textArr.length; i += len) {
// textslicejoin
result.push(textArr.slice(i, i + len).join(''))
}
return result
}
}, },
mounted() { mounted() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -289,6 +312,7 @@
white-space: nowrap; white-space: nowrap;
animation: u-loop-animation 10s linear infinite both; animation: u-loop-animation 10s linear infinite both;
/* #endif */ /* #endif */
@include flex(row);
} }
} }

View File

@ -72,13 +72,11 @@
</view> </view>
</template> </template>
<!-- #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ -->
<script <script
src="./scrollWxs.wxs" src="./scrollWxs.wxs"
module="wxs" module="wxs"
lang="wxs" lang="wxs"
></script> ></script>
<!-- #endif -->
<script> <script>
/** /**

View File

@ -148,7 +148,7 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
/* #ifndef APP-NVUE || MP-WEIXIN */ /* #ifndef APP-NVUE || MP-WEIXIN */
touch-action: none; touch-action: pan-y;
/* #endif */ /* #endif */
&__content { &__content {

View File

@ -109,6 +109,11 @@ export default {
formatter: { formatter: {
type: [Function, null], type: [Function, null],
default: uni.$u.props.textarea.formatter default: uni.$u.props.textarea.formatter
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
} }
} }
} }

View File

@ -21,6 +21,7 @@
:holdKeyboard="holdKeyboard" :holdKeyboard="holdKeyboard"
:maxlength="maxlength" :maxlength="maxlength"
:confirmType="confirmType" :confirmType="confirmType"
:ignoreCompositionEvent="ignoreCompositionEvent"
@focus="onFocus" @focus="onFocus"
@blur="onBlur" @blur="onBlur"
@linechange="onLinechange" @linechange="onLinechange"
@ -68,6 +69,7 @@ import props from "./props.js";
* @property {Boolean} holdKeyboard focus时点击页面的时候不收起键盘只微信小程序有效默认 false * @property {Boolean} holdKeyboard focus时点击页面的时候不收起键盘只微信小程序有效默认 false
* @property {String | Number} maxlength 最大输入长度设置为 -1 的时候不限制最大长度默认 140 * @property {String | Number} maxlength 最大输入长度设置为 -1 的时候不限制最大长度默认 140
* @property {String} border 边框类型surround-四周边框none-无边框bottom-底部边框默认 'surround' * @property {String} border 边框类型surround-四周边框none-无边框bottom-底部边框默认 'surround'
* @property {Boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理
* *
* @event {Function(e)} focus 输入框聚焦时触发event.detail = { value, height }height 为键盘高度 * @event {Function(e)} focus 输入框聚焦时触发event.detail = { value, height }height 为键盘高度
* @event {Function(e)} blur 输入框失去焦点时触发event.detail = {value, cursor} * @event {Function(e)} blur 输入框失去焦点时触发event.detail = {value, cursor}

View File

@ -17,6 +17,7 @@
:selectable="false" :selectable="false"
@longpress.stop="longpressHandler" @longpress.stop="longpressHandler"
:style="{ :style="{
color: color,
backgroundColor: bgColor && showTooltip && tooltipTop !== -10000 ? bgColor : 'transparent' backgroundColor: bgColor && showTooltip && tooltipTop !== -10000 ? bgColor : 'transparent'
}" }"
>{{ text }}</text> >{{ text }}</text>
@ -312,7 +313,6 @@
/* #endif */ /* #endif */
&__text { &__text {
color: $u-content-color;
font-size: 14px; font-size: 14px;
} }

View File

@ -374,6 +374,7 @@
$u-upload-deletable-zIndex:3 !default; $u-upload-deletable-zIndex:3 !default;
$u-upload-success-bottom:0 !default; $u-upload-success-bottom:0 !default;
$u-upload-success-right:0 !default; $u-upload-success-right:0 !default;
$u-upload-success-border-style:solid !default;
$u-upload-success-border-top-color:transparent !default; $u-upload-success-border-top-color:transparent !default;
$u-upload-success-border-left-color:transparent !default; $u-upload-success-border-left-color:transparent !default;
$u-upload-success-border-bottom-color: $u-success !default; $u-upload-success-border-bottom-color: $u-success !default;
@ -479,6 +480,7 @@
// weex(nvue)KPI()lajicss // weex(nvue)KPI()lajicss
// nvue使nvue使css // nvue使nvue使css
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
border-style: $u-upload-success-border-style;
border-top-color: $u-upload-success-border-top-color; border-top-color: $u-upload-success-border-top-color;
border-left-color: $u-upload-success-border-left-color; border-left-color: $u-upload-success-border-left-color;
border-bottom-color: $u-upload-success-border-bottom-color; border-bottom-color: $u-upload-success-border-bottom-color;

View File

@ -1,9 +1,9 @@
// 此版本发布于2022-04-04 // 此版本发布于2022-00-24
const version = '2.0.30' const version = '2.0.34'
// 开发环境才提示,生产环境不会提示 // 开发环境才提示,生产环境不会提示
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
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;'); console.log(`\n %c uView V${version} %c https://uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;');
} }
export default { export default {

View File

@ -10,6 +10,7 @@
export default { export default {
// codeInput 组件 // codeInput 组件
codeInput: { codeInput: {
adjustPosition: true,
maxlength: 6, maxlength: 6,
dot: false, dot: false,
mode: 'box', mode: 'box',

View File

@ -13,6 +13,7 @@ export default {
label: '', label: '',
prop: '', prop: '',
borderBottom: '', borderBottom: '',
labelPosition: '',
labelWidth: '', labelWidth: '',
rightIcon: '', rightIcon: '',
leftIcon: '', leftIcon: '',

View File

@ -17,6 +17,7 @@ export default {
bgColor: '#ffffff', bgColor: '#ffffff',
color: '#C8C8C8', color: '#C8C8C8',
fontSize: 19, fontSize: 19,
iconSize: 28,
loadingColor: '#C8C8C8' loadingColor: '#C8C8C8'
} }
} }

View File

@ -14,6 +14,7 @@ export default {
bgColor: 'transparent', bgColor: 'transparent',
icon: true, icon: true,
fontSize: 14, fontSize: 14,
iconSize: 17,
color: '#606266', color: '#606266',
loadingIcon: 'spinner', loadingIcon: 'spinner',
loadmoreText: '加载更多', loadmoreText: '加载更多',
@ -24,6 +25,8 @@ export default {
marginTop: 10, marginTop: 10,
marginBottom: 10, marginBottom: 10,
height: 'auto', height: 'auto',
line: false line: false,
lineColor: '#E6E8EB',
dashed: false,
} }
} }

View File

@ -20,7 +20,6 @@ export default {
confirmText: '确定', confirmText: '确定',
cancelColor: '#909193', cancelColor: '#909193',
confirmColor: '#3c9cff', confirmColor: '#3c9cff',
singleIndex: 0,
visibleItemCount: 5, visibleItemCount: 5,
keyName: 'text', keyName: 'text',
closeOnClickOverlay: false, closeOnClickOverlay: false,

View File

@ -15,7 +15,7 @@ export default {
placeholderClass: 'textarea-placeholder', placeholderClass: 'textarea-placeholder',
placeholderStyle: 'color: #c0c4cc', placeholderStyle: 'color: #c0c4cc',
height: 70, height: 70,
confirmType: '', confirmType: 'done',
disabled: false, disabled: false,
count: false, count: false,
focus: false, focus: false,

View File

@ -292,15 +292,15 @@ if (!String.prototype.padStart) {
else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
date = new Date(Number(dateTime)) date = new Date(Number(dateTime))
} }
// 其他都认为符合 RFC 2822 规范 // 处理平台性差异在Safari/Webkit中new Date仅支持/作为分割符的字符串时间
else { // 处理 '2022-07-10 01:02:03',跳过 '2022-07-10T01:02:03'
// 处理平台性差异在Safari/Webkit中new Date仅支持/作为分割符的字符串时间 else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) {
date = new Date( date = new Date(dateTime.replace(/-/g, '/'))
typeof dateTime === 'string' }
? dateTime.replace(/-/g, '/') // 其他都认为符合 RFC 2822 规范
: dateTime else {
) date = new Date(dateTime)
} }
const timeSource = { const timeSource = {
'y': date.getFullYear().toString(), // 年 'y': date.getFullYear().toString(), // 年

View File

@ -9,7 +9,7 @@ function email(value) {
* 验证手机格式 * 验证手机格式
*/ */
function mobile(value) { function mobile(value) {
return /^1[23456789]\d{9}$/.test(value) return /^1([3589]\d|4[5-9]|6[1-2,4-7]|7[0-8])\d{8}$/.test(value)
} }
/** /**

View File

@ -77,7 +77,7 @@ module.exports = {
} }
return Object.keys(classes) return Object.keys(classes)
// 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效 // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
// #ifdef MP-ALIPAY || MP-TOUTIAO // #ifdef MP-ALIPAY || MP-TOUTIAO || MP-LARK
.join(' ') .join(' ')
// #endif // #endif
} }

View File

@ -53,7 +53,7 @@ class Router {
mergeConfig.url = this.mixinParam(options, params) mergeConfig.url = this.mixinParam(options, params)
mergeConfig.type = 'navigateTo' mergeConfig.type = 'navigateTo'
} else { } else {
mergeConfig = uni.$u.deepClone(options, this.config) mergeConfig = uni.$u.deepMerge(options, this.config)
// 否则正常使用mergeConfig中的url和params进行拼接 // 否则正常使用mergeConfig中的url和params进行拼接
mergeConfig.url = this.mixinParam(options.url, options.params) mergeConfig.url = this.mixinParam(options.url, options.params)
} }

View File

@ -2,7 +2,7 @@
"id": "uview-ui", "id": "uview-ui",
"name": "uview-ui", "name": "uview-ui",
"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖", "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
"version": "2.0.30", "version": "2.0.34",
"description": "uView UI已完美兼容nvue全面的组件和便捷的工具会让您信手拈来如鱼得水", "description": "uView UI已完美兼容nvue全面的组件和便捷的工具会让您信手拈来如鱼得水",
"keywords": [ "keywords": [
"uview", "uview",
@ -17,12 +17,8 @@
"engines": { "engines": {
"HBuilderX": "^3.1.0" "HBuilderX": "^3.1.0"
}, },
"dcloudext": { "dcloudext": {
"category": [ "sale": {
"前端组件",
"通用组件"
],
"sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
@ -38,7 +34,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/uview-ui" "npmurl": "https://www.npmjs.com/package/uview-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [], "dependencies": [],