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

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

View File

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

View File

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

View File

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

View File

@ -209,12 +209,13 @@ export default {
}
},
init() {
// 校验maxDate不能小于当前时间
// 校验maxDate不能小于minDate
if (
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

View File

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

View File

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

View File

@ -16,11 +16,11 @@
* @property {String} endText 倒计结束的提示语,见官网说明(默认 '重新获取'
* @property {Boolean} keepRunning 是否在H5刷新或各端返回再进入时继续倒计时 默认false
* @property {String} uniqueKey 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了
*
*
* @event {Function} change 倒计时期间,每秒触发一次
* @event {Function} start 开始倒计时触发
* @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 {
name: "u-code",
@ -74,7 +74,6 @@
this.canGetCode = false
// 这里放这句是为了一开始时就提示否则要等setInterval的1秒后才会有提示
this.changeEvent(this.changeText.replace(/x|X/, this.secNum))
this.setTimeToStorage()
this.timer = setInterval(() => {
if (--this.secNum) {
// 用当前倒计时的秒数替换提示字符串中的"x"字母
@ -88,7 +87,8 @@
this.canGetCode = true
}
}, 1000)
},
this.setTimeToStorage()
},
// 重置,可以让用户再次获取验证码
reset() {
this.canGetCode = true

View File

@ -1,146 +1,127 @@
<template>
<view class="u-drawdown-item">
<u-overlay
customStyle="top: 126px"
:show="show"
:closeOnClickOverlay="closeOnClickOverlay"
@click="overlayClick"
></u-overlay>
<view
class="u-drawdown-item__content"
:style="[style]"
:animation="animationData"
ref="animation"
>
<slot />
</view>
</view>
<view class="u-drawdown">
<view
class="u-dropdown__menu"
:style="{
height: $u.addUnit(height)
}"
ref="u-dropdown__menu"
>
<view
class="u-dropdown__menu__item"
v-for="(item, index) in menuList"
:key="index"
@tap.stop="clickHandler(item, index)"
>
<view class="u-dropdown__menu__item__content">
<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>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation')
const dom = uni.requireNativePlugin('dom')
// #endif
import props from './props.js';
/**
* Drawdownitem
* @description
* @tutorial url
* @property {String}
* @event {Function}
* @example
*/
export default {
name: 'u-drawdown-item',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() {
return {
show: false,
top: '126px',
// uni.createAnimation的导出数据
animationData: {},
}
},
mounted() {
this.init()
},
watch: {
// 发生变化时,需要去更新父组件对应的值
dataChange(newValue, oldValue) {
this.updateParentData()
}
},
computed: {
// 监听对应变量的变化
dataChange() {
return [this.title, this.disabled]
},
style() {
const style = {
zIndex: 10071,
position: 'fixed',
display: 'flex',
left: 0,
right: 0
}
style.top = uni.$u.addUnit(this.top)
return style
}
},
methods: {
init() {
this.updateParentData()
},
// 更新父组件所需的数据
updateParentData() {
// 获取父组件u-dropdown
this.getParentData('u-dropdown')
if (!this.parent) uni.$u.error('u-dropdown-item必须配合u-dropdown使用')
// 查找父组件menuList数组中对应的标题数据
const menuIndex = this.parent.menuList.findIndex(item => item.title === this.title)
const menuContent = {
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)
}
},
}
import props from './props.js';
/**
* Dropdown
* @description
* @tutorial url
* @property {String}
* @event {Function}
* @example
*/
export default {
name: 'u-dropdown',
mixins: [uni.$u.mixin, props],
data() {
return {
// <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
menuList: [],
current: 0
}
},
computed: {
},
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>
this.children = [];
},
methods: {
clickHandler(item, index) {
this.children.map(child => {
if(child.title === item.title) {
// this.queryRect('u-dropdown__menu').then(size => {
child.$emit('click')
child.setContentAnimate(child.show ? 0 : 300)
child.show = !child.show
// })
} else {
child.show = false
child.setContentAnimate(0)
}
})
},
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
queryRect(el) {
// #ifndef APP-NVUE
// $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>ͬ
return new Promise(resolve => {
this.$uGetRect(`.${el}`).then(size => {
resolve(size)
})
})
// #endif
// #ifdef APP-NVUE
// 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>
return new Promise(resolve => {
dom.getComponentRect(this.$refs[el], res => {
resolve(res.size)
})
})
// #endif
},
},
}
</script>
<style lang="scss" scoped>
@import '../../libs/css/components.scss';
.u-drawdown-item {
&__content {
background-color: #FFFFFF;
overflow: hidden;
height: 0;
}
}
<style lang="scss">
@import '../../libs/css/components.scss';
.u-dropdown {
&__menu {
@include flex;
&__item {
flex: 1;
@include flex;
justify-content: center;
&__content {
@include flex;
align-items: center;
}
}
}
}
</style>

View File

@ -1,127 +1,127 @@
<template>
<view class="u-drawdown">
<view
class="u-dropdown__menu"
:style="{
<view class="u-drawdown">
<view
class="u-dropdown__menu"
:style="{
height: $u.addUnit(height)
}"
ref="u-dropdown__menu"
>
<view
class="u-dropdown__menu__item"
v-for="(item, index) in menuList"
:key="index"
@tap.stop="clickHandler(item, index)"
>
<view class="u-dropdown__menu__item__content">
<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>
ref="u-dropdown__menu"
>
<view
class="u-dropdown__menu__item"
v-for="(item, index) in menuList"
:key="index"
@tap.stop="clickHandler(item, index)"
>
<view class="u-dropdown__menu__item__content">
<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>
<script>
import props from './props.js';
/**
* Dropdown
* @description
* @tutorial url
* @property {String}
* @event {Function}
* @example
*/
export default {
name: 'u-dropdown',
mixins: [uni.$u.mixin, props],
data() {
return {
// <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
menuList: [],
current: 0
}
},
computed: {
},
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>
this.children = [];
},
methods: {
clickHandler(item, index) {
this.children.map(child => {
if(child.title === item.title) {
// this.queryRect('u-dropdown__menu').then(size => {
child.$emit('click')
child.setContentAnimate(child.show ? 0 : 300)
child.show = !child.show
// })
} else {
child.show = false
child.setContentAnimate(0)
}
})
},
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
queryRect(el) {
// #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
// <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>ͬ
return new Promise(resolve => {
this.$uGetRect(`.${el}`).then(size => {
resolve(size)
})
})
// #endif
// #ifdef APP-NVUE
// nvue<75>£<EFBFBD>ʹ<EFBFBD><CAB9>domģ<6D><C4A3><EFBFBD><EFBFBD>ѯԪ<EFBFBD>ظ߶<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 => {
dom.getComponentRect(this.$refs[el], res => {
resolve(res.size)
})
})
// #endif
},
},
}
import props from './props.js';
/**
* Dropdown
* @description
* @tutorial url
* @property {String}
* @event {Function}
* @example
*/
export default {
name: 'u-dropdown',
mixins: [uni.$u.mixin, props],
data() {
return {
// <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>
menuList: [],
current: 0
}
},
computed: {
},
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>
this.children = [];
},
methods: {
clickHandler(item, index) {
this.children.map(child => {
if(child.title === item.title) {
// this.queryRect('u-dropdown__menu').then(size => {
child.$emit('click')
child.setContentAnimate(child.show ? 0 : 300)
child.show = !child.show
// })
} else {
child.show = false
child.setContentAnimate(0)
}
})
},
// <20><>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ijߴ<C4B3>λ<EFBFBD><CEBB>
queryRect(el) {
// #ifndef APP-NVUE
// $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>ͬ
return new Promise(resolve => {
this.$uGetRect(`.${el}`).then(size => {
resolve(size)
})
})
// #endif
// #ifdef APP-NVUE
// 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>
return new Promise(resolve => {
dom.getComponentRect(this.$refs[el], res => {
resolve(res.size)
})
})
// #endif
},
},
}
</script>
<style lang="scss">
@import '../../libs/css/components.scss';
@import '../../libs/css/components.scss';
.u-dropdown {
&__menu {
@include flex;
&__item {
flex: 1;
@include flex;
justify-content: center;
&__content {
@include flex;
align-items: center;
}
}
}
}
.u-dropdown {
&__menu {
@include flex;
&__item {
flex: 1;
@include flex;
justify-content: center;
&__content {
@include flex;
align-items: center;
}
}
}
}
</style>

View File

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

View File

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

View File

@ -161,10 +161,10 @@
this.$emit('error', err)
},
// 图片加载完成标记loading结束
onLoadHandler() {
onLoadHandler(event) {
this.loading = false
this.isError = false
this.$emit('load')
this.$emit('load', event)
this.removeBgColor()
// 如果不需要动画效果,就不执行下方代码,同时移除加载时的背景颜色
// 否则无需fade效果时png图片依然能看到下方的背景色

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,11 +19,17 @@
class="u-notice__content"
ref="u-notice__content"
>
<text
<view
ref="u-notice__content__text"
class="u-notice__content__text"
:style="[textStyle]"
>{{text}}</text>
:style="[animationStyle]"
>
<text
v-for="(item, index) in innerText"
:key="index"
:style="[textStyle]"
>{{item}}</text>
</view>
</view>
<view
class="u-notice__right-icon"
@ -118,11 +124,28 @@
textStyle() {
let style = {}
style.color = this.color
style.animationDuration = this.animationDuration
style.animationPlayState = this.animationPlayState
style.fontSize = uni.$u.addUnit(this.fontSize)
return style
},
animationStyle() {
let style = {}
style.animationDuration = this.animationDuration
style.animationPlayState = this.animationPlayState
return style
},
// 内部对用户传入的数据进一步分割放到多个text标签循环否则如果用户传入的字符串很长100个字符以上
// 放在一个text标签中进行滚动在低端安卓机上动画可能会出现抖动现象需要分割到多个text中可解决此问题
innerText() {
let result = [],
// 每组text标签的字符长度
len = 20
const textArr = this.text.split('')
for (let i = 0; i < textArr.length; i += len) {
// 对拆分的后的text进行slice分割得到的为数组再进行join拼接为字符串
result.push(textArr.slice(i, i + len).join(''))
}
return result
}
},
mounted() {
// #ifdef APP-PLUS
@ -289,6 +312,7 @@
white-space: nowrap;
animation: u-loop-animation 10s linear infinite both;
/* #endif */
@include flex(row);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -374,6 +374,7 @@
$u-upload-deletable-zIndex:3 !default;
$u-upload-success-bottom: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-left-color:transparent !default;
$u-upload-success-border-bottom-color: $u-success !default;
@ -479,6 +480,7 @@
// 由于weex(nvue)为阿里巴巴的KPI(部门业绩考核)的laji产物不支持css绘制三角形
// 所以在nvue下使用图片非nvue下使用css实现
/* #ifndef APP-NVUE */
border-style: $u-upload-success-border-style;
border-top-color: $u-upload-success-border-top-color;
border-left-color: $u-upload-success-border-left-color;
border-bottom-color: $u-upload-success-border-bottom-color;