@burh/nuxt-core 1.0.372 → 1.0.373
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
placeholder="Cidade"
|
|
106
106
|
filterable
|
|
107
107
|
remote
|
|
108
|
-
:remote-method="
|
|
109
|
-
:auto-complete="
|
|
108
|
+
:remote-method="getCityListFiltered"
|
|
109
|
+
:auto-complete="`new-${city}`"
|
|
110
110
|
:error="errors[0]"
|
|
111
111
|
:valid="errors.length ? true : false"
|
|
112
112
|
:loading="isSelectLoading"
|
|
@@ -116,13 +116,11 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<el-option
|
|
119
|
-
v-for="city in
|
|
119
|
+
v-for="city in cityListFiltered"
|
|
120
120
|
:key="city.value"
|
|
121
121
|
:value="city.value"
|
|
122
122
|
:label="city.value"
|
|
123
|
-
|
|
124
|
-
{{ city.value }}
|
|
125
|
-
</el-option>
|
|
123
|
+
/>
|
|
126
124
|
</el-select>
|
|
127
125
|
</div>
|
|
128
126
|
</validation-provider>
|
|
@@ -234,6 +232,7 @@ export default {
|
|
|
234
232
|
isEditing: false,
|
|
235
233
|
isSelectLoading: false,
|
|
236
234
|
cityList: [],
|
|
235
|
+
cityListFiltered: [],
|
|
237
236
|
permissions: false,
|
|
238
237
|
permessionsData: [
|
|
239
238
|
{
|
|
@@ -280,29 +279,21 @@ export default {
|
|
|
280
279
|
title: message,
|
|
281
280
|
});
|
|
282
281
|
},
|
|
283
|
-
async getCityList(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
282
|
+
async getCityList() {
|
|
283
|
+
this.cityList = await fetch('https://raw.githubusercontent.com/Skuth/cidades-com-estados-brasil/main/cidades.json')
|
|
284
|
+
.then(res => res.json())
|
|
285
|
+
.catch(() => {});
|
|
286
|
+
},
|
|
287
|
+
getCityListFiltered(query) {
|
|
290
288
|
if (query && query.length > 3) {
|
|
291
|
-
this.
|
|
292
|
-
|
|
293
|
-
let cityList = await getCityData();
|
|
294
|
-
|
|
295
|
-
cityList = cityList.filter(city => String(city.city).toLowerCase().startsWith(query.toLowerCase()));
|
|
296
|
-
|
|
297
|
-
this.cityList = cityList.map(city => {
|
|
289
|
+
this.cityListFiltered = this.cityList.filter(city => String(city.city).toLowerCase().startsWith(query.toLowerCase()));
|
|
290
|
+
this.cityListFiltered = this.cityListFiltered.map(city => {
|
|
298
291
|
return {
|
|
299
292
|
value: `${city.city} / ${city.uf}`
|
|
300
293
|
};
|
|
301
294
|
});
|
|
302
|
-
|
|
303
|
-
this.
|
|
304
|
-
} else if (this.cityList.length > 0 && query.length <= 3) {
|
|
305
|
-
this.cityList = [];
|
|
295
|
+
} else {
|
|
296
|
+
this.cityListFiltered = [];
|
|
306
297
|
}
|
|
307
298
|
},
|
|
308
299
|
async checkZipcode() {
|