From bbb9d42037237a331fa56d7786eeba9e48ef20dc Mon Sep 17 00:00:00 2001 From: kjqwer <2990346238@qq.com> Date: Tue, 11 Nov 2025 13:17:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B2=BE=E7=AE=80=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=8F=8C=E5=87=BB=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PromptEditor.vue | 124 ++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 7 deletions(-) diff --git a/src/components/PromptEditor.vue b/src/components/PromptEditor.vue index 305efe7..b715c7b 100644 --- a/src/components/PromptEditor.vue +++ b/src/components/PromptEditor.vue @@ -57,6 +57,7 @@ const tokens = computed(() => store.tokens); const suggestions = ref([]); const inputEl = ref(null); +const editEl = ref(null); const text = ref(''); watch(text, (val) => { @@ -243,6 +244,12 @@ function beginEdit(i: number) { editingIndex.value = i; editingValue.value = tokens.value[i] ?? ''; addingMapIndex.value = null; + nextTick(() => { + if (editEl.value) { + editEl.value.focus(); + try { editEl.value.setSelectionRange(0, editingValue.value.length); } catch {} + } + }); } function commitEdit() { if (editingIndex.value == null) return; @@ -437,7 +444,7 @@ function displayTrans(key: string): string {
- 提示词映射 + 提示词映射(双击修改)
@@ -449,11 +456,12 @@ function displayTrans(key: string): string {
⋮⋮ -
+
+ +
+ + +
+
+
{{ k }} @@ -498,9 +529,9 @@ function displayTrans(key: string): string { -
-
-
+
+
+