在普通页面没有问题,在组件模式中使用editor组件报错。
methods: { onEditorReady() { console.log(wx.createSelectorQuery().select( '#editor' )) wx.createSelectorQuery().select( '#editor' ).context((res) => { this .editorCtx = res.context this .setContent() }).exec() } } |
这里可参考:https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html