Browse Source

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 1 year ago
parent
commit
e3b5e943fd

+ 1 - 4
src/components/byForm/index.vue

@@ -32,9 +32,9 @@
           :placeholder="i.placeholder || '请输入'"
           @input="(e) => commonsEmit(e, i)"
           @change="(e) => commonsEmitChange(e, i)"
-          @keydown.native="inputLimit"
           :type="i.itemType ? i.itemType : 'text'"
           :disabled="i.disabled ? i.disabled : false"
+          v-mousewheel
           :max="i.max"
           :min="i.min"
           :maxlength="i.maxlength"
@@ -308,9 +308,6 @@ const handleSuccess = (res, file, files) => {
   emit("update:modelValue", formData.value);
 };
 
-const inputLimit = (e, i) => {
-  console.log(e,i)
-};
 
 const handleRemove = (file) => {
   const index = fileListCopy.value.findIndex(

+ 2 - 0
src/directive/index.js

@@ -1,9 +1,11 @@
 import hasRole from './permission/hasRole'
 import hasPermi from './permission/hasPermi'
 import copyText from './common/copyText'
+import mousewheel from './permission/mousewheel'
 
 export default function directive(app){
   app.directive('hasRole', hasRole)
   app.directive('hasPermi', hasPermi)
   app.directive('copyText', copyText)
+  app.directive('mousewheel', mousewheel)
 }

+ 15 - 0
src/directive/permission/mousewheel.js

@@ -0,0 +1,15 @@
+/**
+* v-mousewheel 解决type number 鼠标滚轮问题
+* Copyright (c) 2023 29
+*/
+
+
+export default {
+    mounted(el, binding, vnode) {
+        const elem = el.tagName === 'INPUT' ? el : el.querySelector('input');
+        elem.blur();
+        elem.onmousewheel = function (e) {
+            return false;
+        }
+    }
+}

+ 2 - 1
src/views/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="app-container home">
 		<!-- <byTableDemo></byTableDemo> -->
-		
+		<!-- <el-input type="number" v-model='aaa' v-mousewheel></el-input> -->
 		
 	</div>
 </template>
@@ -12,6 +12,7 @@ import byTableDemo from '../components/byTable/demo'
 import html2canvas from 'html2canvas'
 import JsPDF from 'jspdf'
 
+const aaa = ref(1)
 function goTarget(url) {
 	window.open(url, '__blank')
 }