unknown mutation type: m_cart/saveToStorage

简介: unknown mutation type: m_cart/saveToStorage

今天在做一个持久化存储购物车中的商品,使用savesaveToStorage的mutions方法,出现了一个错误:

vendor.js? [sm]:2768 [vuex] unknown mutation type: m_cart/saveToStorage,查了好长时间,才发现在哪里出了问题:

还是粗心,竟然把savesaveToStorage的方法写在mutions对象的外面,难怪报错了,改了一下位置,bug就消失了。

相关文章
|
7月前
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
Each child in a list should have a unique “key“ prop. Check the render method的报错解决
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
Error: Element type is invalid: expected a string (for built-in components) or a class/function
2579 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
|
8月前
|
JavaScript 前端开发
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
298 1
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
104 0
|
前端开发 JavaScript
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
1379 0
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
8月前
|
JavaScript
[Vue warn]_ Avoid using non-primitive value as key, use string_number value instea
[Vue warn]_ Avoid using non-primitive value as key, use string_number value instea
94 1
|
8月前
|
JavaScript
[Vue warn]: Method “components“ has type “object“ in the component definition. Did you reference the
[Vue warn]: Method “components“ has type “object“ in the component definition. Did you reference the
|
JavaScript
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
|
机器学习/深度学习 算法 决策智能
【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods
【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods
111 0
|
机器学习/深度学习 自然语言处理 算法
TABs(Type Abstraction,类型抽象):Open Relation and Event Type Discovery with Type Abstraction论文解读
传统的“封闭世界”信息提取(IE)方法依赖于人类本体来定义抽取范围。因此,当应用到新的领域时,这种方法就不适用了。这就要求系统能够从给定的语料库中自动推断出新的类型
69 0

热门文章

最新文章