Explorar el Código

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

Michael Wang hace 6 años
padre
commit
d19dfafd21
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  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,