diff --git a/src/App.vue b/src/App.vue index a680375375f149180020f2e9a02778046fb45840..48785b7d02f46510bd6147df919b42eb88f1472f 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 4305db9ac479f540c1fc175af253f0b1b69931a4..3a52c3b690f62d2b76ecc280f9de5860fdae8960 100644 --- a/src/components/Goods/Goods.vue +++ b/src/components/Goods/Goods.vue @@ -4,8 +4,9 @@
- -
@@ -26,22 +26,33 @@