vue2 tinymce TypeError: Cannot read properties of undefined (reading 'get')
时间: 2023-10-19 07:34:46 浏览: 73
这个错误是由于在Vue2中使用tinymce编辑器时出现的。根据引用中提供的解决方法,你可以通过以下步骤解决这个问题:
1. 首先,在使用tinymce编辑器的地方使用v-if指令将代码包裹起来。例如,在使用<Editor>标签的地方,你可以这样写:
```
<span v-if="displayEditContainer">
<Editor placeholder="xxxx" class="tinymce_class" :init="initEdit" v-model="videoDesc" />
</span>
```
2. 然后,在mounted生命周期钩子函数中,通过延迟改变displayEditContainer的值来实现延迟加载tinymce编辑器。你可以使用setTimeout函数来延迟执行代码,例如:
```
mounted() {
setTimeout(() => {
this.displayEditContainer = 1
}, 1000);
}
```
这样,编辑器的加载会延迟1秒钟,避免了出现TypeError错误。通过延迟加载,确保了编辑器所需的依赖项已经加载完毕。
你也可以参考引用中提供的链接,获取更多关于这个问题的参考信息。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<...](https://download.csdn.net/download/weixin_38536267/12778353)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [vue tinymce Cannot read properties of undefined (reading ‘open‘)](https://blog.csdn.net/baidu_19473529/article/details/128980118)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)