我的样式是一行排10列
九宫格弹窗显示
代码如下
列表数据
const ymList = ref([
{
ym: "茯苓",
},
{
ym: "白芷",
},
{
ym: "苍耳子",
},
{
ym: "蝉蜕",
},
{
ym: "牛蒡子",
},
{
ym: "桑叶 ",
},
{
ym: "葛根",
},
{
ym: "柴胡",
},
{
ym: "蔓荆子",
},
{
ym: "知母",
},
]);
{{item.ym}}
点击事件
const clickYmIndex = ref(null)
function ymClick(item, index) {
clickYmIndex.value = index;
}
function ymconfirm(){
zbList.value[clickIndex.value].yymc = ymList.value[clickYmIndex.value].ym;
ymDialogVisible.value = false;
}
css样式
.row {
display: flex;
margin-bottom: 5px;
flex-direction: row;
flex-wrap: wrap;
}
.ymdiv {
width: 105px;
height: 105px;
line-height: 105px;
text-align: center;
border-collapse: collapse;
margin-right:-1px;
margin-bottom:-1px;
cursor: pointer;
border: 1px solid #a5a3a3;
}