From 55ba49b599631e31bcd987418e84cdca4f729e96 Mon Sep 17 00:00:00 2001 From: qihuanl Date: Mon, 14 Aug 2023 11:01:32 +0800 Subject: [PATCH] indexList --- components.d.ts | 1 - src/stores/city.ts | 3 +++ src/views/city/index.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components.d.ts b/components.d.ts index c50cade..0ced75b 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,7 +10,6 @@ declare module 'vue' { HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] - VanButton: typeof import('vant/es')['Button'] VanCell: typeof import('vant/es')['Cell'] VanIcon: typeof import('vant/es')['Icon'] VanIndexAnchor: typeof import('vant/es')['IndexAnchor'] diff --git a/src/stores/city.ts b/src/stores/city.ts index cc6fbda..22cfc67 100644 --- a/src/stores/city.ts +++ b/src/stores/city.ts @@ -34,6 +34,9 @@ export const useCity = defineStore("city", { // 返回 result return result.sort((a, b) => (a.groupName > b.groupName ? 1 : -1)); }, + indexList(): string[] { + return (this.cityGroup as any).map((item: any) => item.groupName); + }, }, actions: { diff --git a/src/views/city/index.vue b/src/views/city/index.vue index 275c3db..685e4f5 100644 --- a/src/views/city/index.vue +++ b/src/views/city/index.vue @@ -27,7 +27,7 @@ const keyword = ref("");
- +