Home > Mobile >  Small program editor with setContents error
Small program editor with setContents error

Time:10-07

Index. WXML:

 
Bindready="onEditorReady"
Id="editor"



Index. Js:

 
Page ({

/* *
* the initial data of the page
*/
Data: {
Text: "Hello"
},
OnEditorReady () {
Const that=this
Wx. CreateSelectorQuery (). The select (' # editor). The context (function (res) {
That. EditorCtx=res. The context
}). The exec ()
That. EditorCtx. SetContents ({
HTML: '& lt; Html> <body>

Hello

'
Success: (res)=& gt; {
The console. The log (res)
},
Fail: (res)=& gt; {
The console. The log (res)
}
})
},



Error message:

CodePudding user response:

SetTimeout delay is ok,
  • Related