<template v-slot:footer> <view class="slot-box"> <view class='slot-box'><text class="require">*</text> 使用现状</view> <uni-data-checkbox mode="tag" multiple v-model="formItem.parking_garage_status" :localdata="residence_parking_garage_status"> </uni-data-checkbox> </view> </template>, .slot-box { display: flex; flex-direction: row; justify-content: flex-start; align-items:center; flex-wrap: wrap; //width: 80%; }, <template v-slot:footer> <view class="slot-box"> <view class='slot-box'><text class="require">*</text> 使用现状</view> <uni-data-checkbox mode="tag" multiple v-model="formItem.parking_garage_status" :localdata="residence_parking_garage_status"> </uni-data-checkbox> </view> </template>,需要把使用现状作为独立一行,uni-data-checkbox也独立为一行排布。
时间: 2024-04-11 13:26:43 浏览: 120
如果您想要将"使用现状"和"uni-data-checkbox"独立为一行排布,可以尝试以下方式修改CSS样式:
```css
.slot-box {
display: flex;
flex-direction: column;
}
.uni-data-checkbox {
display: flex;
flex-direction: row;
align-items: center;
}
.require {
margin-right: 4px;
}
```
修改后的代码如下:
```html
<template v-slot:footer>
<view class="slot-box">
<view class='slot-box'><text class="require">*</text> 使用现状</view>
<uni-data-checkbox mode="tag" multiple v-model="formItem.parking_garage_status" :localdata="residence_parking_garage_status">
</uni-data-checkbox>
</view>
</template>
<style>
.slot-box {
display: flex;
flex-direction: column;
}
.uni-data-checkbox {
display: flex;
flex-direction: row;
align-items: center;
}
.require {
margin-right: 4px;
}
</style>
```
这样修改后,"使用现状"和"uni-data-checkbox"会分别独占一行,并且"使用现状"前面会有一个红色星号(*)。请根据您的需求进行适当的调整。
阅读全文