<view class="container">
<view style="height: calc(100vh);">
<editor id="editor" class="ql-container" read-only="true" bindfocus="previewImage">
</editor>
</view>
</view>
js部分,从后端获取富文本的delta进行回显
onEditorReady() {
var that = this
wx.createSelectorQuery().select('#editor').context(function (res) {
that.editorCtx = res.context
var jsonData = that.data.menuBar.jsonData
var context = JSON.parse(jsonData)
that.editorCtx.setContents({
delta: context
})
}).exec()
},
我可以拿到delta里面的图片url数组,并通过wx.previewImage进行图片预览,但是无法根据下标index来判断从第几张图片开始预览
类似问题
https://developers.weixin.qq.com/community/develop/doc/000e2232864a109a8aed7a77f5c800?_at=1733737829070