diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 968e305..017292c 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -107,7 +107,6 @@ export default class LoginPage extends BasePage { get serverAddress(): string | null { return server.serverAddress; } - // 小数点保留 username = ''; @Watch('username') diff --git a/src/utils/mixin.ts b/src/utils/mixin.ts index d04d3a7..78f83ad 100644 --- a/src/utils/mixin.ts +++ b/src/utils/mixin.ts @@ -1,7 +1,7 @@ /* * @Author: zhou lei * @Date: 2022-01-20 11:26:20 - * @LastEditTime: 2022-01-20 17:48:10 + * @LastEditTime: 2022-01-22 10:21:10 * @LastEditors: zhou lei * @Description: * @FilePath: /wms_haiwai_app/src/utils/mixin.ts @@ -9,7 +9,7 @@ */ import Vue from 'vue'; import { Component } from 'vue-property-decorator'; - +import _ from 'lodash'; @Component // 一定要用Component修饰 export default class MyMixins extends Vue { customToast(msg: string, type = 'MODEL', title = '') { @@ -26,4 +26,14 @@ export default class MyMixins extends Vue { }); } } + /** + * search trim 去空格 + * + * @param {*} v + * @param {*} key + * @memberof MyMixins + */ + searchchange(v, key) { + _.set(this, key, this.$u.trim(v)); + } } diff --git a/types/vue-prototype.d.ts b/types/vue-prototype.d.ts index 638147a..bbb2ec4 100644 --- a/types/vue-prototype.d.ts +++ b/types/vue-prototype.d.ts @@ -2,7 +2,7 @@ /* * @Author: zhou lei * @Date: 2022-01-21 09:23:56 - * @LastEditTime: 2022-01-21 11:47:17 + * @LastEditTime: 2022-01-22 09:58:04 * @LastEditors: zhou lei * @Description: * @FilePath: /wms_haiwai_app/types/vue-prototype.d.ts @@ -22,5 +22,16 @@ declare module 'vue/types/vue' { * @memberof Vue */ customToast(msg: string, type?: string = 'toast', title?: string = ''): void; + $u: { + trim(v: any); + }; + /** + * search trim 去空格 + * + * @param {*} v + * @param {*} key + * @memberof Vue + */ + searchchange(v: any, key: any): void; } }