🚩 修复暗黑模式 增加自动填充
This commit is contained in:
@@ -4,12 +4,14 @@ import serversData from '~/server/whois/json/whois-servers.json';
|
||||
// 定义接口来描述state的结构
|
||||
interface DomainState {
|
||||
SupportedTLDs: Record<string, string>;
|
||||
supportedTLDKeys: Set<string>;
|
||||
}
|
||||
|
||||
export const useDomainListStore = defineStore('useDomainListStore', {
|
||||
// 使用箭头函数和类型注解定义state
|
||||
state: (): DomainState => ({
|
||||
SupportedTLDs: {...serversData},
|
||||
supportedTLDKeys: new Set(Object.keys(serversData)) as any,
|
||||
}),
|
||||
actions: {
|
||||
async addSuffix(suffix: string, server: string) {
|
||||
@@ -43,6 +45,14 @@ export const useDomainListStore = defineStore('useDomainListStore', {
|
||||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getSupportedTLDs(state: any) {
|
||||
return state.SupportedTLDs;
|
||||
},
|
||||
getSupportedTLDKeys(state: any) {
|
||||
return state.supportedTLDKeys;
|
||||
}
|
||||
},
|
||||
persist: {
|
||||
storage: persistedState.localStorage,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user