罗世杰:feat:商铺展示列表提供删除和编辑按钮

This commit is contained in:
LuoShijie
2023-11-07 00:17:38 +08:00
parent 7523e0e262
commit b7a4fad4f6
4 changed files with 68 additions and 12 deletions

View File

@@ -6,6 +6,7 @@
:shopInfo="item"
:is-adshow="isADshow"
:show-style="showStyle"
@delItem="handleDel"
></ShowShopListItem>
</view>
</template>
@@ -15,6 +16,7 @@
* @property {Array} shopInfoList 对象数组,(带图片)需要展示的商铺列表
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isADshow 是否显示推广广告
* @property {Boolean} isEdit 是否显示编辑和删除
*/
export default {
name:"ShowShopList",
@@ -27,7 +29,7 @@
showStyle:{
type: Number,
default() {
return 0
return 1
}
},
isADshow: {
@@ -76,6 +78,15 @@
},
computed: {
},
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>