editor组件的在js赋值后会自动聚焦,导致手机弹窗出虚拟键盘出来,怎么才能赋值不触发聚�
发布于 5 年前 作者 weilin 6248 次浏览 来自 官方Issues

for (let i = datas.length - 1; i >= 0; i–) {

let idone = “.editor” + i

wx.createSelectorQuery().select(idone).context(function(res) {

let editorCtx = res.context

editorCtx.setContents({

html: _this.data.objectArr[i].html,

success: function() {

console.log(‘insert html success’)

}

})

}).exec()

}

<editor style=“width: 600rpx;” class=“editor {{‘editor’ + index}}” placeholder-style=“color: red;” placeholder=‘点击添加文字’ maxlength="-1" value=’{{item.text}}’ data-index=’{{index}}’ bindinput=‘textObject’></editor>

1 回复

试试吧,没试过

read-only="{{readOnly}}"

赋值前先

this.setData({

    readOnly: !0

})


全部赋值完才

this.setData({

    readOnly: !1

})


回到顶部