ReferenceError: regeneratorRuntime is not defined

2021-08-27 08:40:06

ReferenceError: regeneratorRuntime is not defined 报错,原因是 

原因是不能解析async … await 等高级语法

原因是不能解析async … await 等高级语法


解决办法:

安装babel-polyfill即可

在main.js中引入


import Vue from 'vue'

import App from './App.vue'

import './plugins/element'


import "babel-polyfill"


new Vue({

  render: h => h(App)

}).$mount('#root')


  • 2019-10-16 21:02:47

    vue中mixins的详细分析一

    混入 (mixins): 是一种分发 Vue 组件中可复用功能的非常灵活的方式。混入对象可以包含任意组件选项。当组件使用混入对象时,所有混入对象的选项将被混入该组件本身的选项。

  • 2019-10-16 21:04:47

    vue中mixins的详细分析二

    当混合里面包含异步请求函数,而我们又需要在组件中使用异步请求函数的返回值时,我们会取不到此返回值,如下: