我正在嘗試在用戶進行選擇后重置“選定”項目。這是調(diào)用下面的 Vue 函數(shù) tS()。第一個調(diào)用$('#sel1').prop('selectedIndex',0);僅在我在控制臺中執(zhí)行時才有效,但是第二個 調(diào)用$('#current-schedule-holder').text('Current : '+scheduleToTime(msg));正常,這意味著 jquery 正在運行。我還console.log($('#sel1'))表明,當函數(shù)執(zhí)行時,第一次調(diào)用中的元素(那個不起作用的元素)已經(jīng)在 DOM 中。tS: function(msg){ $('#sel1').prop('selectedIndex',0); console.log($('#sel1')) $('#current-schedule-holder').text('Current : '+scheduleToTime(msg)); toggleScheduler(this.query, msg);},
Jquery 在一個函數(shù)內(nèi)工作,但僅用于其中一個調(diào)用,另一個我必須在 Chrome 控制臺中手動執(zhí)行
偶然的你
2021-10-29 13:52:27