Browse Source

禁止shift加鼠标左键点击新开窗口

Michael Wang 6 năm trước cách đây
mục cha
commit
d19dfafd21
1 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 11 0
      src/main.js

+ 11 - 0
src/main.js

@@ -75,6 +75,17 @@ if (process.env.NODE_ENV === "development") {
   })();
 }
 
+Vue.mixin({
+  mounted() {
+    // console.log("mixin hook called");
+    [...document.getElementsByTagName("a")].forEach(e => {
+      e.addEventListener("click", function(event) {
+        event.preventDefault();
+      });
+    });
+  }
+});
+
 new Vue({
   router,
   store,