当前位置:网站首页>解决uniapp插件robin-editor设置字体颜色和背景颜色报错的问题
解决uniapp插件robin-editor设置字体颜色和背景颜色报错的问题
2022-06-26 03:07:00 【Lcwai】
今天在h5上使用uniapp开发时使用robin-editor(https://ext.dcloud.net.cn/plugin?id=1345),设置字体颜色和背景颜色报错
报错如下:
[system]TypeError: Cannot read property 'open' of undefined
at VueComponent.eval (webpack-internal:///vK4t:264:28)
at Array.<anonymous> (http://localhost:8080/static/js/chunk-vendors.js:7100:12)
at flushCallbacks (http://localhost:8080/static/js/chunk-vendors.js:7026:14)
at <anonymous>
明显是调用不到那个方法,评论中有人回复
照做没有效果,看了源码,发现116行
<uni-popup type="bottom"><robin-color-picker :color="color" @confirm="colorChanged" ref="color"></robin-color-picker></uni-popup>
由于先加载popup,再加载robin-color-picker,所以直接this.$refs.color是没有值的。
将其改成
<uni-popup type="bottom" ref="popup"><robin-color-picker :color="color" @confirm="colorChanged" ref="color"></robin-color-picker></uni-popup>
再将原261行删除
this.$refs.color.open(color);
修改为
this.$refs.popup.open('bottom');
this.$nextTick(()=>{
this.$refs.color.open(color);
})
完美解决。
边栏推荐
- 渐变
- 校园创客空间的硬件造物原理
- QT compilation error: unknown module (s) in qt: script
- Clion项目中运行多个main函数
- Wealth freedom skills: commercialize yourself
- [system architecture] - how to evaluate software architecture
- Is it safe to open an account in flush online? How to open a brokerage account online
- 2021-08-04
- GStreamer allocator and pool
- 多媒体元素,音频、视频
猜你喜欢
随机推荐
关于#sql#的问题:SQL问题--账号多地登录的SQL代码
解析少儿编程的多元评价体系
todolist未完成,已完成
Add console programs in UE
Business process diagram design
Is it safe to open a fund account? How to apply
kotlin快速上手
Xgboost, lightgbm, catboost -- try to stand on the shoulders of giants
Scratch returns 400
使用IDEA画结构图
[system architecture] - how to evaluate software architecture
Leetcode 176 The second highest salary (June 25, 2022)
Is it safe to open an online stock account?
【QT】自定义控件-空气质量仪表盘
Classic quotations from "human nature you must not know"
Learn from Taiji makers - mqtt (V) publish, subscribe and unsubscribe
Authorization of database
云计算基础-0
Leetcode 175 Combine two tables (2022.06.24)
jupyter notebook的插件安装以及快捷键