From 338857c357f4566f8902e81875a43ab8b998177c Mon Sep 17 00:00:00 2001
From: 642b59b229c89a1824b83ed8 <642b59b229c89a1824b83ed8@devide>
Date: Sat, 29 Apr 2023 05:51:00 +0000
Subject: [PATCH] Sat Apr 29 05:51:00 UTC 2023 inscode
---
src/App.vue | 14 ++++++++-
src/components/Goods/Goods.vue | 57 +++++++++++++++++++++-------------
2 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index a680375..48785b7 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,7 +7,9 @@
+ :id="item.id" @good_check_change="updateGoodState">
+
+
@@ -15,6 +17,7 @@
import axios from 'axios' // 导入 axios 模块
import Header from '@/components/Header/Header.vue' // 导入 Header 组件
import Goods from '@/components/Goods/Goods.vue' // 导入 Goods 组件
+import Footer from '@/components/Footer/Footer.vue'
export default {
components: {
@@ -37,6 +40,15 @@ export default {
this.list = res.list
}
+ },
+ updateGoodState(e){
+ this.list.some(item=>{
+ if (item.id === e.id)
+ {
+ item.goods_state = e.state
+ return true
+ }
+ })
}
},
created() {
diff --git a/src/components/Goods/Goods.vue b/src/components/Goods/Goods.vue
index 4305db9..3a52c3b 100644
--- a/src/components/Goods/Goods.vue
+++ b/src/components/Goods/Goods.vue
@@ -4,8 +4,9 @@