P粉8795174032023-09-02 11:46:50
v-for
is used to loop through a set of data, which is not what you want. Assuming id
is the identifier in your json
, try this:
b-modal(hide-footer="", :id="id") template(#modal-title="") | 信息 .d-block.text-center p() {{ offers[id].jobDescription }} b-button(variant="primary") 申请
If you store the selected id
as a data variable, you can put it in a computed property:
computed: { selected() { return this.offers[this.id].jobDescription; } }
(Edit: I didn't realize you posted your json, my previous answer was for arrays)