我似乎無法反彈(lodash)計算屬性或vuex獲取者。去抖動函數總是返回undefined。反彈在Vue中計算的屬性/獲得者
https://jsfiddle.net/guanzo/yqk0jp1j/2/
HTML:
<div id="app">
<input v-model="text">
<div>computed: {{ textComputed }} </div>
<div>debounced: {{ textDebounced }} </div>
</div>
JS:
new Vue({
el:'#app',
data:{
text:''
},
computed:{
textDebounced: _.debounce(function(){
return this.text
},500),
textComputed(){
return this.text
}
}
})
你開到替代解決方案或者是你要求去抖適用於計算的項目嗎? – mrogers
嗯,我想知道它爲什麼不起作用,但是肯定你有什麼樣的替代解決方案? –
看到這個有趣的小提琴:https://jsfiddle.net/yqk0jp1j/3/ – Cobaltway