@@ -157,7 +157,7 @@ export default defineComponent({
this.addGoodsShow = false
}}
>
- <AddGoodsCart item={this.selectGoodsItem} />
+ <AddGoodsCart show={this.addGoodsShow} item={this.selectGoodsItem} />
</Popup>
</div>
)
@@ -382,6 +382,7 @@ export default defineComponent({
<AddGoodsCart
+ show={this.addGoodsShow}
onGetCartCount={() => this.getCartCount()}
item={this.selectGoodsItem}
defaultRadio={this.radio}
@@ -19,6 +19,10 @@ import request from '@/helpers/request'
export default defineComponent({
name: 'add-goods-cart',
props: {
+ show: {
+ type: Boolean,
+ default: false,
+ },
item: {
type: Object,
default: {}
@@ -37,11 +41,13 @@ export default defineComponent({
}
},
watch:{
- item(){
- this.totalData = {}
- this.total = 1
- this.radio = ''
- this.setList()
+ show(val){ // 添加购物车显示
+ if (val){
+ this.totalData = {}
+ this.total = 1
+ this.radio = ''
+ this.setList()
+ }
data() {