guhongwei 4 år sedan
förälder
incheckning
b6b58abe72
3 ändrade filer med 26 tillägg och 222 borttagningar
  1. 13 13
      public/index.html
  2. 7 209
      src/views/market/index.vue
  3. 6 0
      src/views/market/marketlists.vue

+ 13 - 13
public/index.html

@@ -14,18 +14,18 @@
       <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
     <div id="app"></div>
-    <!-- built files will be auto injected -->
-      <script language=javascript>
-          // 禁止右键菜单
-            document.oncontextmenu = function () { return false; };
-            // 禁止文字选择
-            document.onselectstart = function () { return false; };
-            // 禁止复制
-            document.oncopy = function () { return false; };
-            // 禁止剪切
-            document.oncut = function () { return false; };
-            // 禁止粘贴
-            document.onpaste = function () { return false; };
-      </script>
+      <!-- built files will be auto injected -->
+      <!-- <script language=javascript>
+        // 禁止右键菜单
+        document.oncontextmenu = function () { return false; };
+        // 禁止文字选择
+        document.onselectstart = function () { return false; };
+        // 禁止复制
+        document.oncopy = function () { return false; };
+        // 禁止剪切
+        document.oncut = function () { return false; };
+        // 禁止粘贴
+        document.onpaste = function () { return false; };
+      </script> -->
   </body>
 </html>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 7 - 209
src/views/market/index.vue


+ 6 - 0
src/views/market/marketlists.vue

@@ -179,6 +179,12 @@ export default {
   async created() {
     await this.searchColumn();
     await this.searchCom();
+    this.$nextTick(() => {
+      // 禁用右键
+      document.oncontextmenu = new Function('event.returnValue=false');
+      // 禁用选择
+      document.onselectstart = new Function('event.returnValue=false');
+    });
   },
   methods: {
     ...product({ productList: 'newquery', productFetch: 'newfetch' }),