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 { -
-
-
+
+
+