mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
address: sort cities by code and then by name + improve city display
This commit is contained in:
parent
f7954d5159
commit
62c0410bf5
@ -68,7 +68,9 @@ export default {
|
|||||||
return this.$data.value !== null && typeof this.$data.value.text !== 'undefined';
|
return this.$data.value !== null && typeof this.$data.value.text !== 'undefined';
|
||||||
},
|
},
|
||||||
cities() {
|
cities() {
|
||||||
return this.entity.loaded.cities;
|
return this.entity.loaded.cities.sort(
|
||||||
|
(a, b) => Number(a.code) - Number(b.code) || a.name > b.name
|
||||||
|
)
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
set(value) {
|
set(value) {
|
||||||
@ -92,7 +94,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
transName(value) {
|
transName(value) {
|
||||||
return (value.code && value.name) ? `${value.code}-${value.name}` : '';
|
return (value.code && value.name) ? `${value.name} (${value.code})` : '';
|
||||||
},
|
},
|
||||||
selectCity(value) {
|
selectCity(value) {
|
||||||
this.entity.selected.city = value;
|
this.entity.selected.city = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user