未验证 提交 bd9bce86 编写于 作者: N Nicky Chan 提交者: GitHub

Improve performance of sliding smoothing slider by debouncing value (#312)

上级 1816767d
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
:max="0.99" :max="0.99"
:min="0" :min="0"
:step="0.01" :step="0.01"
v-model="config.smoothing" v-model="smoothingValue"
class="visual-dl-page-smoothing-slider" class="visual-dl-page-smoothing-slider"
dark></v-slider> dark></v-slider>
<span class="visual-dl-page-slider-span">{{config.smoothing}}</span> <span class="visual-dl-page-slider-span">{{smoothingValue}}</span>
</div> </div>
<v-radio-group label="Horizontal" v-model="config.horizontal" dark> <v-radio-group label="Horizontal" v-model="config.horizontal" dark>
...@@ -80,9 +80,17 @@ export default { ...@@ -80,9 +80,17 @@ export default {
], ],
sortingMethodItems: [ sortingMethodItems: [
'default', 'descending', 'ascending', 'nearest' 'default', 'descending', 'ascending', 'nearest'
] ],
smoothingValue: this.config.smoothing
}; };
}, },
watch: {
smoothingValue: _.debounce(
function() {
this.config.smoothing = this.smoothingValue;
}, 50
)
},
methods: { methods: {
toggleAllRuns() { toggleAllRuns() {
this.config.running = !this.config.running; this.config.running = !this.config.running;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册