chore: fui-preview 增加tag右边位置模式

This commit is contained in:
Hefeng
2023-10-23 18:26:37 +08:00
parent e0f96cd5d1
commit 0489e10abf

View File

@ -154,15 +154,26 @@ export default {
type: Boolean,
default: true,
},
// tag上下padding
tagPadding: {
type: [Number, String],
default: 8,
},
// 标题是否显示蓝色竖线条
isSection: {
type: Boolean,
default: false,
},
// tag是否在右边
isTagRight: {
type: Boolean,
default: false,
},
// 组件上边距
topPadding: {
type: [Number, String],
default: 0,
},
},
emits: ['click', 'valueClick'],
data() {
@ -254,10 +265,10 @@ export default {
>
<view
v-if="pvd[label] || pvd[value]" class="fui-preview__hd"
:style="{ paddingLeft: `${padding}rpx`, paddingRight: `${padding}rpx` }"
:style="{ paddingLeft: `${padding}rpx`, paddingRight: `${padding}rpx`,paddingTop: `${topPadding}rpx`}"
>
<view class="fui-preview__item">
<fui-section v-if="isSection" :title="pvd[label] || ''" is-line line-width="8rpx" :padding="['0','0']" line-color="#0082ff" />
<fui-section v-if="isSection" :title="pvd[label] || ''" is-line line-width="8rpx" :padding="['0','0']" :line-color="fuiColor.primary" />
<text
v-else
class="fui-preview__label" style="color: #333;font-weight:600"
@ -279,7 +290,7 @@ export default {
:class="{ 'fui-preview__border-color': !borderColor }"
/>
</view>
<view :style="{ paddingLeft: `${padding}rpx`, paddingRight: `${padding}rpx`,paddingTop: `${tagPadding}rpx`,paddingBottom: `${tagPadding}rpx`}">
<view :style="{ paddingLeft: `${padding}rpx`, paddingRight: `${padding}rpx`,paddingTop: `${tagPadding}rpx`,paddingBottom: `${tagPadding}rpx`}" :class="{'tag-right':isTagRight}">
<slot name="tag" />
</view>
@ -607,6 +618,11 @@ export default {
transform-origin: 100% 0;
transform: scaleX(.5)
}
.tag-right{
position: absolute;
right: 0;
top: 0;
}
/* #endif */