vue下用箭头函数报错
音狐狸 2019-08-02 05:14:00 webstorm上用箭头函数报错
created: function () {
this.$http.get("http://jsonplaceholder.typicode.com/users")
.then((data))=>{
this.users = data.body;
}
}
版本里面也设置了es6了
Failed to compile.
./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Home.vue
Module build failed: SyntaxError: E:\实习\vue\vue-playlist\src\components\Home.vue: Unexpected token, expected ; (53:19)
51 | created: function () {
52 | this.$http.get("http://jsonplaceholder.typicode.com/users")
> 53 | .then((data))=>{
| ^
54 | this.users = data.body;
55 |
56 | }
@ ./src/components/Home.vue 8:0-104 9:0-117
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js