详细问题描述
[内容]
本人初学者,在使用Vuex+Axios时,一些函数的写法,HBuilder不认可。
但我在其它浏览器访问时正常,导致调试时,总是提示错误。
actions: {
FetchDatas: function({commit}) {
axios.get('http://127.0.0.1:8080/getdbconn')
.then(function(response) {
console.log(response.data);
commit("FetchDatas", response.data);
})
.catch(function(error) {
console.log(error);
});
}
}
提示错误:
[Web浏览器] "Uncaught SyntaxError: Unexpected token {" /mssql2mysql/views/new1.html (55)
错误内容指向 FetchDatas: function({commit}) { 这行,应该是:{commit}这个写法不认可
联系方式
[QQ]49481249
很喜欢HBuilder
1 个回复
回梦無痕 - 暂停服务
建议使用plus.net.XMLHttpRequest();
如果引用了mui,就使用mui.ajax