From ad149e571ccd808530965c8561530cacc18f8f6e Mon Sep 17 00:00:00 2001 From: Professional Date: Fri, 23 May 2025 15:05:46 +0700 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B3=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B4=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ProfileView.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/ProfileView.vue b/src/views/ProfileView.vue index 10c57cf..6531734 100644 --- a/src/views/ProfileView.vue +++ b/src/views/ProfileView.vue @@ -810,10 +810,13 @@ const loadCities = async () => { const response = await import('@/assets/russian-cities.json'); const rawData = response.default || []; - // Проверяем, что данные - массив строк + // Проверяем, что данные - массив if (Array.isArray(rawData)) { - // Фильтруем и очищаем данные, оставляя только строки - cities = rawData.filter(city => typeof city === 'string'); + // Извлекаем названия городов из объектов + cities = rawData.map(city => { + // Проверяем, является ли city объектом и содержит ли поле name + return typeof city === 'object' && city !== null && city.name ? city.name : null; + }).filter(cityName => cityName !== null); // Удаляем null элементы } else { cities = []; console.error('[ProfileView] Неверный формат данных городов:', typeof rawData);