fix: 自定义弹窗组件支持内容居中
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<view v-if="closeTip" style="color:rgba(255,255,255,0.15); letter-spacing: 5rpx; margin-top: 50%;text-align: center">{{closeTip}}</view>
|
<view v-if="closeTip" style="color:rgba(255,255,255,0.15); letter-spacing: 5rpx; margin-top: 50%;text-align: center">{{closeTip}}</view>
|
||||||
<view class="model-con" @click.stop>
|
<view class="model-con" @click.stop>
|
||||||
<view class="model-top" v-if="title">{{ title }}</view>
|
<view class="model-top" v-if="title">{{ title }}</view>
|
||||||
<view :class="{'model-middle': true,'m-height': !title}">
|
<view :class="{'model-middle': true,'m-height': !title, 'align-center': contentAlign==='center'}">
|
||||||
<view v-for="text in content.split('\n')">{{text}}</view>
|
<view v-for="text in content.split('\n')">{{text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="model-bottom">
|
<view class="model-bottom">
|
||||||
@@ -39,6 +39,9 @@ const props = defineProps({
|
|||||||
content: {
|
content: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
|
contentAlign: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
cancelBtn: {
|
cancelBtn: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
@@ -130,6 +133,10 @@ const handleConfirm = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.align-center{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.m-height {
|
.m-height {
|
||||||
padding-top: 28rpx;
|
padding-top: 28rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user