diff --git a/resources/assets/js/components/TEditor.vue b/resources/assets/js/components/TEditor.vue index 5d857b660..e3b57e7d8 100755 --- a/resources/assets/js/components/TEditor.vue +++ b/resources/assets/js/components/TEditor.vue @@ -303,7 +303,12 @@ $A.messageWarning("没有可预览的图片") return; } - this.$store.state.previewImageIndex = 0; + let index = 0; + const imgElm = editor.selection.getNode(); + if (imgElm && imgElm.nodeName === "IMG") { + index = array.findIndex(item => item === imgElm.getAttribute("src")); + } + this.$store.state.previewImageIndex = index; this.$store.state.previewImageList = array; } });