罗世杰:faet:SearchShopList组件支持第二种样式

This commit is contained in:
LuoShijie
2023-11-07 21:41:15 +08:00
parent bfb9decb93
commit 9d701e7442
5 changed files with 146 additions and 9 deletions

View File

@@ -4,6 +4,8 @@
v-for="item in shopInfoList"
:key="searchid"
:shopInfo="item"
:show-style="showStyle"
@delItem="handleDel"
></SearchShopListItem>
</view>
</template>
@@ -20,6 +22,18 @@
};
},
props: {
showStyle:{
type: Number,
default() {
return 0
}
},
isEdit: {
type: Boolean,
default() {
return false
}
},
shopInfoList: {
type: Array,
default() {
@@ -33,7 +47,8 @@
pos: '锦江区',
category: '餐饮美食',
uname: 'A先生',
sqr: 500
sqr: 500,
yjtzText: "423万元"
},
{
searchid: 2,
@@ -44,11 +59,21 @@
pos: '锦江区',
category: '餐饮美食',
uname: '王先生',
sqr: 200
sqr: 200,
yjtzText: "423万元"
}
]
}
}
},
methods: {
handleDel(shopid){
console.log("删除了商铺", shopid);
// const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid)
// TODO不能直接修改
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
// console.log(this.shopInfoList);
}
}
}
</script>