Skip to content

Commit b5a4b80

Browse files
authored
perf: Add list item add button (#4259)
fixes: #4254
1 parent 792fb69 commit b5a4b80

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

dashboard/src/components/shared/ListConfigItem.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
</div>
2525
<v-btn size="small" color="primary" variant="tonal" @click="openDialog">
26-
{{ preferSingleItem ? '添加更多' : (buttonText || t('core.common.list.modifyButton')) }}
26+
{{ preferSingleItem ? t('core.common.list.addMore') : (buttonText || t('core.common.list.modifyButton')) }}
2727
</v-btn>
2828
</div>
2929

@@ -48,6 +48,14 @@
4848
:placeholder="t('core.common.list.inputPlaceholder')"
4949
class="flex-grow-1">
5050
</v-text-field>
51+
<v-btn
52+
@click="addItem"
53+
variant="tonal"
54+
color="primary"
55+
size="small"
56+
:disabled="!newItem.trim()">
57+
{{ t('core.common.list.addButton') }}
58+
</v-btn>
5159
<v-btn
5260
@click="showBatchImport = true"
5361
variant="tonal"
@@ -318,4 +326,4 @@ function cancelBatchImport() {
318326
.v-chip {
319327
margin: 2px;
320328
}
321-
</style>
329+
</style>

dashboard/src/i18n/locales/en-US/core/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"list": {
7575
"addItemPlaceholder": "Add new item, press Enter to confirm",
7676
"addButton": "Add",
77+
"addMore": "Add More",
7778
"batchImport": "Batch Import",
7879
"batchImportTitle": "Batch Import",
7980
"batchImportLabel": "One item per line",

dashboard/src/i18n/locales/zh-CN/core/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"list": {
7575
"addItemPlaceholder": "添加新项,按回车确认添加",
7676
"addButton": "添加",
77+
"addMore": "添加更多",
7778
"batchImport": "批量导入",
7879
"batchImportTitle": "批量导入",
7980
"batchImportLabel": "每行一个项目",
@@ -94,4 +95,4 @@
9495
"copy": "复制",
9596
"noData": "暂无数据"
9697
}
97-
}
98+
}

0 commit comments

Comments
 (0)