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就消失了。

相关文章
|
3月前
|
CDN
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
Iconfont——Error: <path> attribute d: Expected number, "MNaNNaNaNaNNaNNaN…".
39 0
|
5月前
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的报错解决
|
4月前
|
前端开发
前端使用 <el-descriptions>标签报错: <el-descriptions> - did you register the component correctly
前端使用 <el-descriptions>标签报错: <el-descriptions> - did you register the component correctly
332 0
|
5月前
el-progress进度条提示Invalid prop: custom validator check failed for prop “status“
el-progress进度条提示Invalid prop: custom validator check failed for prop “status“
300 0
【已解决】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
2557 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
|
6月前
|
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,
255 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.组件直接循环套用了
101 0
|
Java Android开发
**** cannot be resolved to a type
这种错误很常见,90%的原因都是没有导入jar包,如果导入的jar包都正确,那么很有可能是一下两个原因导致的
99 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问题
1354 0
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
6月前
|
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
79 1