当我使用"quill image resize vue";,对齐到中心或右边,但当我去看结果时,它是左对齐的。
它并不是在所有情况下都会发生,但我无法确定它在哪些情况下会失败。
我唯一注意到的是,当它工作时,img属性具有"显示:块";以及";margin:auto";。
这是我的代码:
import { VueEditor } from "vue2-editor";
import { ImageDrop } from "quill-image-drop-module";
import ImageResize from "quill-image-resize-vue";
export default {
name: "format-document-form",
components: {
VueEditor,
},
data: function () {
editorData: "<p>Desarrollo de la agenda...</p>",
customModulesForEditor: [
{ alias: "imageDrop", module: ImageDrop },
{ alias: "imageResize", module: ImageResize },
],
editorSettings: {
modules: {
imageDrop: true,
imageResize: {},
},
},
}
}
HTML:
<vue-editor
v-model="editorData"
:customModules="customModulesForEditor"
:editorOptions="editorSettings"
></vue-editor>
当我创建时,它看起来是这样的:形成
但当我解释HTML时,它看起来是这样的:结果html
我最近在我的vue2编辑器中添加了quill image resize vue,并发现编辑器中的以下一组步骤保留了对齐:
- 单击所需的对齐方式
- 调整图像大小
- 保存html数据
只需调整图像大小就可以了,但图像对齐作为一个独立的操作似乎不起作用。
Vue编辑器主工具栏中的对齐选项似乎可以正确对齐图像,所以我只是在使用这些选项。为了在调整图像大小时禁用对齐,我使用了:
editorSettings: {
modules: {
imageResize: {
modules: ['Resize', 'DisplaySize']
},
}
}