- 获取editor 赋值之后为空 怎么解决?
var infoList = ""; that.editorCtx.getContents({ success: function(res) { //console.log(res.text) var infoitem; infoitem='{"' + that.data.jsonName[0] + '":"'+ res.text +'","' + that.data.jsonName[1] + '":"' + that.data.tempFilePaths + '","' + that.data.jsonName[2] + '":"' + that.data.classify1 + '","'+ that.data.jsonName[3] + '":"'+ that.data.classify2 + '","' + that.data.jsonName[4] + '":"' + that.data.classifyid + '","' + that.data.jsonName[5] + '":"' + that.data.price + '","' + that.data.jsonName[6] + '":"' + that.data.inventory + '"}'; infoList='"IssueIdle":['+ infoitem +']'; console.log("=======1111111=========" + infoList); } }) console.log("=======2222222=========" + infoList); [图片]
2021-11-10 - editor组件editorCtx.getContentTxt 第一次获取为空? 第二次才获取到值
// 初始化富文本编辑器 onEditorReady:function(e){ wx.createSelectorQuery().select('#editor').context(function(res) { that.editorCtx = res.context }).exec() }, //获取编辑器输入的内容 getContent: function(e) { that.editorCtx.getContentTxt({ success: function(res) { that.setData({ editorValue : res.text }) } }) }, uploadData:function(e){ this.getContent(); console.log("===文本内容===" + that.data.editorValue); },
2021-11-01