1
沒有人知道如何執行this.isLoading = true之前,在這種方法debounce?模擬負載微調前debounce
它應該是一個加載微調器,當通過axios進行異步調用時將會動畫。
methods: {
searchAdminUsers: _.debounce(function(query) {
this.isLoading = true
axios.get('api/searchEmployees?format=json', { params: { q:query } })
.then(response => {
let data = response.data.map(item => (
{ text: `${item.FIRSTNAME} ${item.LASTNAME} - ${item.POSITION}`, id: item.ID }
))
this.options = data
this.isLoading = false
})
.catch(error => {
console.log(error)
})
}, 250)
}