便引诗情上碧霄 2023-02-20 21:33 采纳率: 0%
浏览 63

TypeError: E is not a constructor

在vue2中配置wangEditor富文本编辑器,js代码如下


```javascript
                const E = window.wangEditor;
                // 绑定div上的 editor
                this.editor = new E('#editor')


然后浏览器提示报错如下
TypeError: E is not a constructor
    at Vue.initialEditor (systemBroadCast.html:213:31)
    at Vue.mounted (systemBroadCast.html:206:18)
    at invokeWithErrorHandling (vue.js:3669:63)
    at callHook$1 (vue.js:3076:15)
    at mountComponent (vue.js:2950:11)
    at Vue.$mount (vue.js:9266:14)
    at Vue.$mount (vue.js:11825:20)
    at Vue._init (vue.js:4692:18)
    at new Vue (vue.js:5729:12)


```

  • 写回答

2条回答 默认 最新

  • Halifax ‎ 2023-02-20 21:57
    关注

    已经给你提示了:
    E不是一个构造函数,你不能new E

    评论

报告相同问题?

问题事件

  • 修改了问题 2月20日
  • 创建了问题 2月20日