diff --git a/src/components/dialog/PluginMarketSettingDialog.vue b/src/components/dialog/PluginMarketSettingDialog.vue index e0984a77..6517a2b3 100644 --- a/src/components/dialog/PluginMarketSettingDialog.vue +++ b/src/components/dialog/PluginMarketSettingDialog.vue @@ -199,13 +199,13 @@ function startEdit(index: number) { } /** 保存当前行内编辑的仓库地址。 */ -function saveEdit() { - if (editingIndex.value === null) return +function saveEdit(index = editingIndex.value) { + if (index === null) return const url = editingUrl.value.trim() - if (!validateRepoUrl(url, editingIndex.value)) return + if (!validateRepoUrl(url, index)) return - repoList.value[editingIndex.value] = url + repoList.value[index] = url syncTextFromList() editingIndex.value = null editingUrl.value = '' @@ -330,10 +330,10 @@ onMounted(() => {
{{ index + 1 }} - {{ formatRepoDisplay(repo) }} + {{ formatRepoDisplay(repo) }}
- + {{ repo }} @@ -345,7 +345,7 @@ onMounted(() => { variant="outlined" hide-details autofocus - @keyup.enter="saveEdit" + @keyup.enter="saveEdit(index)" @keyup.escape="cancelEdit" /> @@ -364,8 +364,13 @@ onMounted(() => { @@ -383,16 +388,17 @@ onMounted(() => {
- +
+ +