From 0a179e7fb603ee60abd6da8cab6876c57ceb301c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20G=C3=BCven?= Date: Tue, 13 Sep 2022 17:49:15 +0300 Subject: [PATCH] Avoid event triggering repeatedly Event is triggering repeatedly because the v-model is already assigning the value. In the following usage, there is no need to assign the element value again as the v-model is already used. --- doc/vue.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/vue.md b/doc/vue.md index 1e3113bd..f455cdf9 100644 --- a/doc/vue.md +++ b/doc/vue.md @@ -16,7 +16,6 @@ Vue.directive('cleave', { update: (el) => { const event = new Event('input', {bubbles: true}); setTimeout(function () { - el.value = el.cleave.properties.result el.dispatchEvent(event) }, 100); } @@ -38,7 +37,6 @@ export default { update: (el) => { const event = new Event('input', {bubbles: true}); setTimeout(function () { - el.value = el.cleave.properties.result el.dispatchEvent(event) }, 100); }