<div>
<div class="form-group height35">
<label class="col-sm-3 control-label paddingRight0 fontStyle"></label>
<div class="col-sm-8 paddingLeft0">
<select name="" id="" class="form-control" v-model="chooseCurrentModuls">
<option :value="item.chapterName" v-for="(item,index) in chooseModules" :key="index">{{item.chapterName}}</option>
</select>
</div>
</div>
</div>
<button slot="footer" type="button" class="btn btn-default sameButton sureButton" @click="sureAddToReport()"></button>
<button slot="footer" type="button" class="btn btn-default sameButton cancelButton" @click="openJoinReport=false"></button>
as in the code above, when you select the template drop-down menu, you want to pass the index of the selected value to the sureAddToReport method that is triggered when the OK button is clicked. But now I don"t know how to pass index to the outside world. You can"t get the value of key by using getAttribute.
how to deal with this problem and pass index to external methods?
add that chooseCurrentModuls= chooseModules [index] .chapterName, the reason why you do not need to get the chooseCurrentModuls is because it is found in the test that this value can have the same name, which will lead to errors in other parameters passed to the background. You need to use index to determine other parameters in chooseModules
.