1.保存数据

sws 2024-08-22
v1.0.0
sws 2024-08-23 17:54:24 +08:00
parent 7ce3af502a
commit 0b755ce0c6
1 changed files with 5 additions and 3 deletions

View File

@ -6,9 +6,9 @@
<!-- 工具栏 -->
<Toolbar id="toolbar-container" :editor="editor_ref" :default-config="toolbar_config" :mode="mode" />
<!-- 编辑器 -->
<Editor id="editor-container" v-model="form.html" class="editor" :default-config="editor_config" :mode="mode" @on-change="handle_change" @on-created="handle_created" />
<Editor id="editor-container" ref="editorRef" v-model="form.html" class="editor" :default-config="editor_config" :mode="mode" @on-change="handle_change" @on-created="handle_created" />
</div>
<upload v-model:model-value="upload_list" v-model:visible-dialog="visibleDialog" :type="rich_upload_type" is-custom-dialog @update:model-value="upload_list_change"></upload>
<upload v-model:model-value="upload_list" v-model:visible-dialog="visibleDialog" :type="rich_upload_type" :limit="1" is-custom-dialog @update:model-value="upload_list_change"></upload>
</card-container>
</div>
</template>
@ -24,6 +24,7 @@ const props = defineProps({
const form = reactive(props.value);
const mode = ref('default'); //
const editorRef = ref<HTMLElement | null>(null);
// shallowRef
const editor_ref = shallowRef();
//
@ -89,7 +90,8 @@ const upload_list_change = (arry: uploadList[]) => {
// editor.select(cursor_position.value);
// // editor.deleteFragment();
editor.dangerouslyInsertHtml(new_html);
// editor.dangerouslyInsertHtml(new_html);
console.log(editorRef);
}
upload_list.value = [];
};