index.wxml:
<editor placeholder="sdfasdfad"
bindready="onEditorReady"
id="editor"
></editor>
index.js:
Page({
/**
* 頁面的初始資料
*/
data: {
text:"Hello"
},
onEditorReady() {
const that = this
wx.createSelectorQuery().select('#editor').context(function (res) {
that.editorCtx = res.context
}).exec()
that.editorCtx.setContents({
html: '<html><body><p>Hello<p></body></html>',
success: (res) => {
console.log(res)
},
fail: (res) => {
console.log(res)
}
})
},
報錯資訊:
uj5u.com熱心網友回復:
setTimeout 延時就可以了,轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/118480.html
標籤:微信開發
上一篇:哪里有uniapp視頻教程?
