不確定這里發(fā)生了什么,但是當(dāng)我單擊調(diào)用函數(shù)的按鈕時(shí),它不會顯示我的模態(tài)。函數(shù)調(diào)用本身有效,因?yàn)槿绻胰∠⑨?,注釋掉的警?bào)將顯示。我如何需要在此方法中顯示模態(tài)?控制臺中也沒有錯(cuò)誤<button @click="eventClick"></button><div id="example-modal"> <!-- Modal --> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Modal title</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> hihi </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> </div>eventClick: function(e) { var eventObj = e.event; //alert('Clicked ' + eventObj.title); let element = this.$refs.modal.$el; $(element).modal('show');
在調(diào)用的 vue 方法中顯示模式
喵喵時(shí)光機(jī)
2021-10-14 16:46:01