这就是我的 json 的样子。我以 v-for 格式显示其中一堆,并且可以单击其中一个。我想显示我在模式中单击的元素的数据。
[{
"id": 1,
"companyName": "test",
"image": "https://mmelektronik.com.pl/wp-content/uploads/2017/10/Insert-logo.jpg.png",
"location": "Warsaw",
"salary": "10000",
"skill": "Junior",
"tags": "test",
"jobDescription": "test",
"title": "UI Designer"
}
]
Now I want to access only jobDescription and display it in the modal.
b-modal(hide-footer="", :id="id")
template(#modal-title="")
| Information
.d-block.text-center
p {{ want the jobDescription here }}
b-button(variant="primary") Apply
这就是我打开模式的方式。
openModal(item) {
this.offer = item;
this.$bvModal.show(this.id);
}
成分
b-container
b-card.joblist__post.mt-2(
v-for="offer in filteredOffers",
:id="id"
:key="offer.id",
@click="openModal"
)
.d-flex
.joblist.d-flex.w-100
.joblist__info.d-flex.align-items-center
.company-logo.d-flex.align-items-center.mr-3
b-img.logo(:src="offer.image")
.joblist-name.d-flex.flex-column.text-left
h5.mb-0.font-weight-bold {{ offer.title }}
.located.d-flex.align-items-center.mt-2.justify-content-start
b-icon.mr-2(icon="geo-alt-fill")
p.m-0.text-secondary.joblist-span {{ offer.location }}
b-icon.mx-2(icon="person-fill")
p.m-0.text-secondary.joblist-span {{ offer.companyName }}
b-icon.mx-2(icon="bar-chart-fill")
b-modal(hide-footer="", :id="id")
template(#modal-title="")
| Information
.d-block.text-center
p {{offer.jobDescription}}
b-button(variant="primary") Ok
export default {
data() {
return {
search: "",
};
},
倚天杖
MMTTMM
相关分类