<template v-slot="{ row }"> <div class="cell-center button--default" @click="toDeatil(row.F_card_id)"> <img src="@/assets/images/student-list/icon-detail.png" alt="" /> </div> <div class="cell-center button--default" @click="toDeatil(row.F_card_id)"> <img src="@/assets/images/student-list/icon-detail.png" alt="" /> </div> </template> 怎么加display:flax
时间: 2024-01-03 09:25:09 浏览: 279
Vue插槽_特殊特性slot,slot-scope与指令v-slot说明
你可以在包裹这两个 div 的最外层元素上添加 `display: flex` 样式来使其变为 flex 布局,例如:
```html
<template v-slot="{ row }">
<div class="flex-container">
<div class="cell-center button--default" @click="toDeatil(row.F_card_id)">
<img src="@/assets/images/student-list/icon-detail.png" alt="" />
</div>
<div class="cell-center button--default" @click="toDeatil(row.F_card_id)">
<img src="@/assets/images/student-list/icon-detail.png" alt="" />
</div>
</div>
</template>
```
```css
.flex-container {
display: flex;
}
```
阅读全文