Commit 014fa738 by 潘际乾

watch的防抖

parent ffbd3384
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,6 +12,7 @@
"cluster": "^0.7.7",
"element-ui": "^2.13.2",
"es6-promise": "^4.2.8",
"lodash": "^4.17.21",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
......
import _ from "lodash"
import commonDeclare from "./commonDeclare"
import commonApi from "./commonApi"
export default {
......@@ -17,7 +18,7 @@ export default {
return
const that = this;
Object.keys(that.defaultRules).forEach(key => {
that.$watch("model." + key, that.defaultRules[key])
that.$watch("model." + key, _.debounce(that.defaultRules[key], 1000))
})
},
ruleCheck() {
......
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