修改楼层装修中商品装修出现的默认不显示bug

master
lemon橪 2021-08-16 11:31:59 +08:00
parent 9e4449257e
commit 334a27a12b
1 changed files with 18 additions and 23 deletions

View File

@ -1,32 +1,15 @@
<template>
<div class="layout">
<div class="goods-cell-title">
<div
class="goods-item-title"
:class="{ selected: selected.index == index }"
@click="handleClickTitle(title, index)"
v-for="(title, index) in res.list[0].titleWay"
:key="index"
>
<div class="goods-item-title" :class="{ selected: selected.index == index }" @click="handleClickTitle(title, index)" v-for="(title, index) in res.list[0].titleWay" :key="index">
<h4>{{ title.title }}</h4>
<div>{{ title.desc }}</div>
</div>
</div>
<div class="goods-list">
<div
v-if="selected.val == item.type"
class="goods-item"
v-for="(item, item_index) in res.list[0].listWay"
:key="item_index"
>
<div v-if="selected.val == item.type" class="goods-item" v-for="(item, item_index) in res.list[0].listWay" :key="item_index">
<div class="goods-img">
<Icon
size="20"
color="#e1251b"
@click="closeGoods(item, item_index)"
class="goods-icon"
type="ios-close-circle"
/>
<Icon size="20" color="#e1251b" @click="closeGoods(item, item_index)" class="goods-icon" type="ios-close-circle" />
<img :src="item.img" alt />
</div>
<div class="goods-desc">
@ -45,17 +28,29 @@
export default {
data() {
return {
selected: { //
selected: {
//
index: 0,
val: "精选",
val: "",
},
};
},
props: ["res"],
watch: {
res: {
handler(val) {
// selected
if (val) {
this.selected.val = this.res.list[0].listWay[0].type;
}
},
immediate: true,
},
},
methods: {
//
closeGoods(val, index) {
this.res.list[0].listWay.splice(index,1)
this.res.list[0].listWay.splice(index, 1);
},
//
handleClickTitle(val, index) {