作者:dengyuanc_928 | 来源:互联网 | 2023-09-07 19:55
我希望仅在VueJS下拉列表中调用第7和第8行。我显然可以对此进行硬编码,但这对我来说没有好处,因为我还将调用分配给这些行的不同数据。我尝试将这些值仅与这两个值绑定到一个数组中,但仍然没有得到结果。
Escrow Office class="highlights" :optiOns="select.offices" :on-change="selectOffice" :searchable="false" :clear-search-on-select="false" v-model="select.officeSelected" >
data() { return { now: new Date().toISOString(),document: { escrow_office_id: 1,},select: { offices: [],officeSelected: 'Choose Escrow Office',} },methods: { init(){ if(this.listing != null) { getEscrow() { this.page.loading = true; axios.get('/api/v2/escrows/' + this.page.id,{headers: {'Authorization': 'Bearer ' + this.$root.access_token}}) .then(respOnse=> { this.escrow = response.data.escrow; this.document.escrow_office_id = response.data.escrow.escrow_office_id; this.select.officeSelected = this.select.offices.find(x => x.value === this.form.escrow_office_id); }) .catch(e => { var err = (!!e.response ? (!!e.response.data ? (!!e.response.data.error ? e.response.data.error : '') : '') : ''); if (err != "") this.$noty.error("Error: " + err); else this.$noty.error("Cannot call getEscrow()"); }) .finally(() => { this.page.loading = false; }); },getShared() { this.select.offices = this.$root.shared.escrow_offices; },selectOffice(option) { this.select.officeSelected = option; this.document.escrow_office_id = option.value; },