mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-21 08:46:46 +08:00
防抖的bug
This commit is contained in:
@@ -125,7 +125,16 @@ watch(() => modelV.value.value, () => {
|
|||||||
emit("update:validated", 1);
|
emit("update:validated", 1);
|
||||||
emit("update:value", modelV.value.value);
|
emit("update:value", modelV.value.value);
|
||||||
});
|
});
|
||||||
|
const timer = ref(null)
|
||||||
|
watch(()=>props.validated, (val)=>{
|
||||||
|
if(val===1){
|
||||||
|
timer.value = setTimeout(() => {
|
||||||
|
emit("update:validated", 2);
|
||||||
|
}, 10000);
|
||||||
|
}else{
|
||||||
|
clearTimeout(timer.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
async function validateValue() {
|
async function validateValue() {
|
||||||
if (!modelV.value.value) {
|
if (!modelV.value.value) {
|
||||||
return Promise.reject("请输入名称");
|
return Promise.reject("请输入名称");
|
||||||
|
|||||||
Reference in New Issue
Block a user