Commit 7705f22c authored by June's avatar June

fixed:选择数量组件,父组件defaultVal改变,子组件没有监听变化

parent d115cec6
...@@ -47,6 +47,10 @@ export default { ...@@ -47,6 +47,10 @@ export default {
} }
}, },
watch: { watch: {
// calVal用于内部计算,但是父组件改变了defaultVal的值会不更新calVal(临时解决)
defaultVal(newVal) {
this.calVal = ~~newVal
},
calVal: throttle(function(newVal) { calVal: throttle(function(newVal) {
const max = this.max const max = this.max
const min = this.min const min = this.min
...@@ -57,7 +61,7 @@ export default { ...@@ -57,7 +61,7 @@ export default {
params: this.params, params: this.params,
val: newVal_number val: newVal_number
}) })
}, 800) }, 500)
}, },
methods: { methods: {
clear(e) { clear(e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment