同じ行に表示される複数のビューまたはテキスト タグをビュー タグで囲みます。
コードは以下のように表示されます
//情况1(html代码)
<view class="propertyBox">
<text class="title1">标签编号:</text>
<text class="content1">{
{
checkLabel.code}}</text>
</view>
//情况2(html代码)
<view class="propertyBox3">
<text class="content2" v-for="(item, index) in deviceList">{
{
item.name}}</text>
</view>
//css代码
.propertyBox{
flex-flow: row;
justify-content: flex-start;
display: flex;
}
効果は以下の通りです
Justify-content はテキスト レイアウト要件に従って変更できます: この属性
/* 对齐方式 */
justify-content: center; /* 居中排列 */
justify-content: start; /* 从行首开始排列 */
justify-content: end; /* 从行尾开始排列 */
justify-content: flex-start; /* 从行首起始位置开始排列 */
justify-content: flex-end; /* 从行尾位置开始排列 */
justify-content: left; /* 一个挨一个在对齐容器得左边缘 */
justify-content: right; /* 元素以容器右边缘为基准,一个挨着一个对齐, */
/* 基线对齐 */
justify-content: baseline;
justify-content: first baseline;
justify-content: last baseline;
/* 分配弹性元素方式 */
justify-content: space-between; /* 均匀排列每个元素
首个元素放置于起点,末尾元素放置于终点 */
justify-content: space-around; /* 均匀排列每个元素
每个元素周围分配相同的空间 */
justify-content: space-evenly; /* 均匀排列每个元素
每个元素之间的间隔相等 */
justify-content: stretch; /* 均匀排列每个元素
'auto'-sized 的元素会被拉伸以适应容器的大小 */
/* 溢出对齐方式 */
justify-content: safe center;
justify-content: unsafe center;
/* 全局值 */
justify-content: inherit;
justify-content: initial;
justify-content: unset;