Refactor SaleSection component: Introduce methods section to organize component logic, enhancing readability and maintainability. This change improves the structure of the component by clearly separating computed properties and methods.
This commit is contained in:
@@ -251,6 +251,8 @@
|
|||||||
return new Date(a.eta).getTime() - new Date(b.eta).getTime();
|
return new Date(a.eta).getTime() - new Date(b.eta).getTime();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
speedLabel(value) {
|
speedLabel(value) {
|
||||||
if (value == null) return this.$t('falukant.branch.transport.speed.unknown') || '—';
|
if (value == null) return this.$t('falukant.branch.transport.speed.unknown') || '—';
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
@@ -264,7 +266,6 @@
|
|||||||
const translated = this.$t(tKey);
|
const translated = this.$t(tKey);
|
||||||
return (!translated || translated === tKey) ? key : translated;
|
return (!translated || translated === tKey) ? key : translated;
|
||||||
},
|
},
|
||||||
},
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.loadInventory();
|
await this.loadInventory();
|
||||||
await this.loadTransports();
|
await this.loadTransports();
|
||||||
|
|||||||
Reference in New Issue
Block a user