1. 修复modal组件按钮写错问题

2. 尝试解决安卓端swiper卡死问题
parent 174642f1
<template> <template>
<view> <view>
<u-modal v-model="show" :title-style="{color: 'red'}"></u-modal> <u-modal v-model="show" :title-style="{color: 'red'}">
<view class="slot-content">
<rich-text :nodes="content"></rich-text>
</view>
</u-modal>
<u-button @click="open"> <u-button @click="open">
打开模态框 打开模态框
</u-button> </u-button>
...@@ -11,7 +15,11 @@ ...@@ -11,7 +15,11 @@
export default { export default {
data() { data() {
return { return {
show: false show: false,
content: `
空山新雨后<br>
天气晚来秋
`
} }
}, },
methods: { methods: {
...@@ -21,6 +29,10 @@ ...@@ -21,6 +29,10 @@
} }
} }
</script> </script>
<style> <style lang="scss" scoped>
.slot-content {
font-size: 28rpx;
color: $u-content-color;
padding-left: 30rpx;
}
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
class="u-model-footer-button" class="u-model-footer-button"
type="default" type="default"
:style="[cancelBtnStyle]" :style="[cancelBtnStyle]"
@click="confirm" @tap="cancel"
> >
{{cancelText}} {{cancelText}}
</view> </view>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
hover-class="btn-hover" hover-class="btn-hover"
class="u-model-footer-button hairline-left" class="u-model-footer-button hairline-left"
:style="[confirmBtnStyle]" :style="[confirmBtnStyle]"
@tap="close" @tap="confirm"
> >
{{confirmText}} {{confirmText}}
</view> </view>
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
this.$emit('confirm'); this.$emit('confirm');
this.$emit('input', false); this.$emit('input', false);
}, },
close() { cancel() {
this.$emit('cancel'); this.$emit('cancel');
this.$emit('input', false); this.$emit('input', false);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="u-swiper-wrap" :style="{ <view class="u-swiper-wrap" :style="{
borderRadius: `${borderRadius}rpx`, borderRadius: `${borderRadius}rpx`,
}"> }">
<swiper @change="change" :current="current" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay" <swiper @change="change" @animationfinish="animationfinish" :current="current" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{ :style="{
height: height + 'rpx' height: height + 'rpx'
...@@ -180,7 +180,15 @@ ...@@ -180,7 +180,15 @@
this.$emit('click', index); this.$emit('click', index);
}, },
change(e) { change(e) {
// #ifdef MP-TOUTIAO
this.current = e.detail.current; this.current = e.detail.current;
// #endif
},
// 头条小程序不支持animationfinish事件,改由change事件
animationfinish() {
// #ifndef MP-TOUTIAO
this.current = e.detail.current;
// #endif
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment