uniapp editor 怎么异步赋值呢

1***@qq.com
- 发布:2020-10-09 21:04
- 更新:2021-05-09 18:36
- 阅读:1334
2 个回复
6***@qq.com
没法解决,editor的初始化ready方法在异步返回之前就执行了,只执行1次,只能先拿到异步数据,然后渲染editor组件
aiyide
数据请求成功后,回调函数里 调用 editor_ready() description的值是请求回来的值
editor_ready() {
复制代码
var mythis=this; // #ifdef APP-PLUS || H5 ||MP-WEIXIN uni.createSelectorQuery().select('#editor').context((res) => { mythis.editorCtx = res.context; mythis.editorCtx.setContents({ html:mythis.description }); }).exec() // #endif }