mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 02:49:49 +08:00
【升级】升级小程序简短UI框架UView至2.0.34版本。
This commit is contained in:
@@ -1,3 +1,16 @@
|
|||||||
|
## 2.0.34(2022-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`设置为当前日期,并且当前时间大于08:00时无法显示日期列表的问题 (#724)
|
||||||
|
9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680)
|
||||||
|
10. 修复`timeFormat`函数在safari重的兼容性问题 (#664)
|
||||||
## 2.0.33(2022-06-17)
|
## 2.0.33(2022-06-17)
|
||||||
# uView2.0重磅发布,利剑出鞘,一统江湖
|
# uView2.0重磅发布,利剑出鞘,一统江湖
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
:shape="shape"
|
:shape="shape"
|
||||||
:customStyle="customStyle"
|
:customStyle="customStyle"
|
||||||
:formatter="formatter"
|
:formatter="formatter"
|
||||||
|
:ignoreCompositionEvent="ignoreCompositionEvent"
|
||||||
@focus="$emit('focus')"
|
@focus="$emit('focus')"
|
||||||
@blur="e => $emit('blur', e)"
|
@blur="e => $emit('blur', e)"
|
||||||
@keyboardheightchange="$emit('keyboardheightchange')"
|
@keyboardheightchange="$emit('keyboardheightchange')"
|
||||||
|
|||||||
@@ -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)"
|
||||||
|
|||||||
@@ -209,12 +209,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
// 校验maxDate,不能小于当前时间
|
// 校验maxDate,不能小于minDate
|
||||||
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
|
||||||
|
|||||||
@@ -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
|
||||||
// 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示
|
// 这里放这句,是为了一开始时就提示,否则要等setInterval的1秒后才会有提示
|
||||||
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
|
||||||
|
|||||||
@@ -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',
|
// <20>˵<EFBFBD><CBB5><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() {
|
||||||
},
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(u-dropdown-item)<29><>this<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>data<74><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CEA2>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><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',
|
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
|
||||||
display: 'flex',
|
queryRect(el) {
|
||||||
left: 0,
|
// #ifndef APP-NVUE
|
||||||
right: 0
|
// $uGetRectΪuView<65>Դ<EFBFBD><D4B4>Ľڵ<C4BD><DAB5>ѯ<EFBFBD><EFBFBD><F2BBAFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ܣ<EFBFBD>https://www.uviewui.com/js/getRect.html
|
||||||
}
|
// <20><><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>this.$uGetRect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊthis.$u.getRect<63><74><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><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<75>£<EFBFBD>ʹ<EFBFBD><CAB9>domģ<6D><C4A3><EFBFBD>ѯԪ<D1AF>ظ߶<D8B8>
|
||||||
updateParentData() {
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>promise<73><65><EFBFBD>õ<EFBFBD><C3B5>ô˷<C3B4><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>then<65>ص<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>
|
||||||
|
|||||||
@@ -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 {
|
||||||
// <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
|
// <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
menuList: [],
|
menuList: [],
|
||||||
current: 0
|
current: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(u-dropdown-item)<29><>this<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>data<74><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CEA2>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(u-dropdown-item)<29><>this<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>data<74><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CEA2>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
|
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
|
||||||
queryRect(el) {
|
queryRect(el) {
|
||||||
// #ifndef APP-NVUE
|
// #ifndef APP-NVUE
|
||||||
// $uGetRectΪuView<65>Դ<EFBFBD><D4B4>Ľڵ<C4BD><DAB5><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>https://www.uviewui.com/js/getRect.html
|
// $uGetRectΪuView<65>Դ<EFBFBD><D4B4>Ľڵ<C4BD><DAB5>ѯ<EFBFBD><EFBFBD><F2BBAFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ܣ<EFBFBD>https://www.uviewui.com/js/getRect.html
|
||||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>this.$uGetRect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊthis.$u.getRect<63><74><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD>Ʋ<EFBFBD>ͬ
|
// <20><><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>this.$uGetRect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊthis.$u.getRect<63><74><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><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<75>£<EFBFBD>ʹ<EFBFBD><CAB9>domģ<6D><C4A3><EFBFBD><EFBFBD>ѯԪ<EFBFBD>ظ߶<EFBFBD>
|
// nvue<75>£<EFBFBD>ʹ<EFBFBD><CAB9>domģ<6D><C4A3><EFBFBD>ѯԪ<D1AF>ظ߶<D8B8>
|
||||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>promise<73><65><EFBFBD>õ<EFBFBD><C3B5>ô˷<C3B4><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>then<65>ص<EFBFBD>
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>promise<73><65><EFBFBD>õ<EFBFBD><C3B5>ô˷<C3B4><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>then<65>ص<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>
|
||||||
|
|||||||
@@ -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],
|
||||||
|
|||||||
@@ -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" -->
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
// 此版本发布于2022-06-17
|
// 此版本发布于2022-00-24
|
||||||
const version = '2.0.33'
|
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 {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export default {
|
|||||||
label: '',
|
label: '',
|
||||||
prop: '',
|
prop: '',
|
||||||
borderBottom: '',
|
borderBottom: '',
|
||||||
|
labelPosition: '',
|
||||||
labelWidth: '',
|
labelWidth: '',
|
||||||
rightIcon: '',
|
rightIcon: '',
|
||||||
leftIcon: '',
|
leftIcon: '',
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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(), // 年
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.33",
|
"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": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user