OSDN Git Service

一旦transitionを使おうと思ったがやめた。
authortkskjri05 <t.kujirai@nagatake.co.jp>
Fri, 30 Apr 2021 12:34:59 +0000 (21:34 +0900)
committertkskjri05 <t.kujirai@nagatake.co.jp>
Fri, 30 Apr 2021 12:34:59 +0000 (21:34 +0900)
src/components/snackBar.vue

index 152992d..fccfe4b 100644 (file)
@@ -26,12 +26,16 @@ export default {
     show() {
       var x = document.getElementById("snackbar");
       x.className = "show";
-      setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2000);
+      if(!this.isShow){
+        this.isShow = true
+        setTimeout(() => { x.className = x.className.replace("show", ""); this.isShow=false;}, 2000);
+      }
     }
   },
   data() {
     return {
       msgValue: '',
+      isShow: false,
     }
   },
 }