VUEX ...map

computed: {
    ...mapState({
        active: state => state.active,
    })
    ...mapGetters(["sidebarRouters", "sidebar"]),
},
methods:{
    ...mapMutations(['***','***'])
    ...mapActions(['***']),
}
...mapMutations('cart', ['toggleCheck'])// 单个商品的选中和选不中 <van-checkbox @click="toggleCheck(item.goods_id)" :value="item.isChecked" ></van-checkbox>为什么会报错:[Vue warn]: Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'isChecked')" found in ---> <VanCheckbox> <CartPage> at src/views/Layout/cart.vue <LayoutIndex> at src/views/Layout/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:4482 logError @ vue.runtime.esm.js:2985 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 invokeWithErrorHandling @ vue.runtime.esm.js:2965 invoker @ vue.runtime.esm.js:1846 invokeWithErrorHandling @ vue.runtime.esm.js:2957 Vue.$emit @ vue.runtime.esm.js:3621 eval @ checkbox.js:79 setTimeout(异步) onClick @ checkbox.js:78 invokeWithErrorHandling @ vue.runtime.esm.js:2957 invoker @ vue.runtime.esm.js:1846 original_1._wrapper @ vue.runtime.esm.js:7078 显示另外 13 个框架 收起 vue.runtime.esm.js:2989 TypeError: Cannot read properties of undefined (reading 'isChecked') at Store.toggleCheck (cart.js:18:1) at wrappedMutationHandler (vuex.esm.js:801:13) at commitIterator (vuex.esm.js:448:7) at Array.forEach (<anonymous>) at eval (vuex.esm.js:447:11) at Store._withCommit (vuex.esm.js:594:3) at Store.commit (vuex.esm.js:446:8) at Store.boundCommit [as commit] (vuex.esm.js:389:19) at local.commit (vuex.esm.js:749:13) at VueComponent.mappedMutation (vuex.esm.js:950:90) logError @ vue.runtime.esm.js:2989 globalHandleError @ vue.runtime.esm.js:2981 handleError @ vue.runtime.esm.js:2949 invokeWithErrorHandling @ vue.runtime.esm.js:2965 invoker @ vue.runtime.esm.js:1846 invokeWithErrorHandling @ vue.runtime.esm.js:2957 Vue.$emit @ vue.runtime.esm.js:3621 eval @ checkbox.js:79 setTimeout(异步) onClick @ checkbox.js:78 invokeWithErrorHandling @ vue.runtime.esm.js:2957 invoker @ vue.runtime.esm.js:1846 original_1._wrapper @ vue.runtime.esm.js:7078 显示另外 12 个框架 收起
07-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值