laravel - 当我使用 vuex 时,laravel 返回 Unexpected token 错误
问题描述
我正在使用 laravel 和 vuejs。当我尝试从商店的方法访问时,vuex mapAction 出现意外的令牌错误。
这是我的 vue 组件中的代码:错误来自 mapActions 前面的三个点 (...)。
import { mapActions } from 'vuex';
export default {
name:'SettingComponent',
methods(){
...mapActions(['fetchSetting'])
},
created(){
this.fetchSetting();
}
}
解决方案
try formatting it this way
methods:{
...mapActions(['fetchSetting'])
},
推荐阅读
- mysql - 插入触发器后的Mysql给出错误
- python - 使用python3计算txt文件特定部分的单词出现次数
- node.js - heroku 和 node.js 没有找到带有请求模块的 php 文件
- python - 如何在 Python 中仅读取/选择输入的一部分?
- python - 如何使用 Python 在 Windows 中处理带有空格的长路径
- javascript - Browserify npm 库
- python - python .timestamp() 方法计算不同时区的错误(或相同)unix 时间
- android - 是否可以在调试模式下运行 Crashlytics?
- flutter - 哪个是更快和性能更好的 Provider、bloc 模式还是 flutter_redux?
- c# - 如何设置属性消息组 ID