From 25df88d0ab9d7444ed1d162b9efa1259ac2f6f66 Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期一, 27 四月 2026 10:13:53 +0800
Subject: [PATCH] 小程序对接finish
---
frontend-admin/src/views/ContentSettingsView.vue | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/frontend-admin/src/views/ContentSettingsView.vue b/frontend-admin/src/views/ContentSettingsView.vue
index 956fc67..5aa7741 100644
--- a/frontend-admin/src/views/ContentSettingsView.vue
+++ b/frontend-admin/src/views/ContentSettingsView.vue
@@ -12,12 +12,14 @@
<div class="editor-wrap" v-loading="loading">
<Toolbar
+ :key="`toolbar-${activeTab}`"
class="w-toolbar"
:editor="editorRef"
:default-config="toolbarConfig"
mode="default"
/>
<Editor
+ :key="`editor-${activeTab}`"
v-model="currentHtml"
class="w-editor"
:default-config="editorConfig"
@@ -40,7 +42,7 @@
<script setup lang="ts">
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
-import { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, ref } from "vue";
+import { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, ref, watch } from "vue";
import { ElMessage } from "element-plus";
import http from "../api/http";
import type { IEditorConfig } from "@wangeditor/editor";
@@ -108,6 +110,11 @@
editorRef.value = editor as never;
}
+watch(activeTab, async () => {
+ editorRef.value = undefined;
+ await nextTick();
+});
+
async function load() {
loading.value = true;
try {
@@ -134,6 +141,7 @@
parkFlowHtml: form.value.parkFlowHtml,
aboutUsEnabled: form.value.aboutUsEnabled,
});
+ await load();
ElMessage.success("已保存");
} catch (e: unknown) {
ElMessage.error(e instanceof Error ? e.message : "保存失败");
--
Gitblit v1.7.1