Skip to content

Commit

Permalink
Enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
youshandefeiyang committed Jun 10, 2024
1 parent 8092ff1 commit 6430faa
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/views/Subconverter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
allow-create
filterable
@change="selectChanged"
@blur="(event) => handleBlur(event, 'customBackend')"
placeholder="可输入自己的后端"
style="width: 100%"
>
Expand All @@ -46,6 +47,7 @@
v-model="form.shortType"
allow-create
filterable
@blur="(event) => handleBlur(event, 'shortTypes')"
placeholder="可输入其他可用短链API"
style="width: 100%"
>
Expand All @@ -57,6 +59,7 @@
v-model="form.remoteConfig"
allow-create
filterable
@blur="(event) => handleBlur(event, 'remoteConfig')"
placeholder="请选择"
style="width: 100%"
>
Expand Down Expand Up @@ -482,15 +485,6 @@ export default {
"sub-web作者提供": "https://api.wcc.best",
"sub作者&lhie1提供": "https://api.dler.io",
},
backendOptions: [
{value: "https://url.v1.mk"},
{value: "https://sub.d1.mk"},
{value: "https://api.tsutsu.one"},
{value: "https://www.nameless13.com"},
{value: "https://sub.xeton.dev"},
{value: "https://api.wcc.best"},
{value: "https://api.dler.io"},
],
remoteConfig: [
{
label: "通用",
Expand Down Expand Up @@ -963,6 +957,16 @@ export default {
} //监听系统主题,自动切换!
},
methods: {
handleBlur(event, optionType) {
const inputElement = event.target;
const inputValue = inputElement.value;
if (inputValue && !this.options[optionType].find(option => option.value === inputValue)) {
this.options[optionType].unshift({ value: inputValue, label: inputValue });
}
this.form[optionType] = inputValue;
},
selectChanged() {
this.getBackendVersion();
},
Expand Down

0 comments on commit 6430faa

Please sign in to comment.