.babelrc : es2017
Vue: 2.2.6
`
methods: {
async getTaskList(){
let data = await this.$store.dispatch('TaskList', tid)
console.log("TaskList", data);
}
},
mounted() {
this.getTaskList();
}
`
But I got the error in chrome console:
vue.esm.js?65d7:479 [Vue warn]: Error in mounted hook: "ReferenceError: regeneratorRuntime is not defined"
Hello, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue - thank you!
I find the solution:
1.
npm install --save-dev babel-plugin-transform-runtime
{
"presets": [
"es2017", ["env", "commonjs"],
"stage-2"
],
"plugins": [["transform-runtime", {
"polyfill": false,
"regenerator": true
}]]
}
You should just include regenerator-runtime or babel-polyfill by yourself rather than use babel-plugin-transform-runtime which will increase your bundle size.
Most helpful comment
I find the solution:
1.
npm install --save-dev babel-plugin-transform-runtime{ "presets": [ "es2017", ["env", "commonjs"], "stage-2" ], "plugins": [["transform-runtime", { "polyfill": false, "regenerator": true }]] }