|
Lines 76-81
export default {
Link Here
|
| 76 |
}, |
76 |
}, |
| 77 |
methods: { |
77 |
methods: { |
| 78 |
async fetchInitialData(dataType) { |
78 |
async fetchInitialData(dataType) { |
|
|
79 |
const currentSelection = this.modelValue |
| 80 |
? this.data.find( |
| 81 |
item => this.modelValue === item[this.dataIdentifier] |
| 82 |
) |
| 83 |
: null |
| 79 |
const client = APIClient.erm |
84 |
const client = APIClient.erm |
| 80 |
await client[dataType] |
85 |
await client[dataType] |
| 81 |
.getAll( |
86 |
.getAll( |
|
Lines 88-94
export default {
Link Here
|
| 88 |
) |
93 |
) |
| 89 |
.then( |
94 |
.then( |
| 90 |
items => { |
95 |
items => { |
| 91 |
this.data = items |
96 |
this.data = currentSelection |
|
|
97 |
? [currentSelection, ...items] |
| 98 |
: items |
| 92 |
this.search = "" |
99 |
this.search = "" |
| 93 |
this.limit = 19 |
100 |
this.limit = 19 |
| 94 |
this.scrollPage = 1 |
101 |
this.scrollPage = 1 |
| 95 |
- |
|
|