You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
893 B
TypeScript
40 lines
893 B
TypeScript
/*
|
|
* @Author: zhou lei
|
|
* @Date: 2022-01-20 11:26:20
|
|
* @LastEditTime: 2022-01-22 10:21:10
|
|
* @LastEditors: zhou lei
|
|
* @Description:
|
|
* @FilePath: /wms_haiwai_app/src/utils/mixin.ts
|
|
* 联系方式:910592680@qq.com 18669792120
|
|
*/
|
|
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 = '') {
|
|
if (type === 'toast') {
|
|
uni.showToast({
|
|
title: msg,
|
|
});
|
|
} else {
|
|
uni.showModal({
|
|
title: title,
|
|
content: msg,
|
|
confirmText: '确定',
|
|
cancelText: '取消',
|
|
});
|
|
}
|
|
}
|
|
/**
|
|
* search trim 去空格
|
|
*
|
|
* @param {*} v
|
|
* @param {*} key
|
|
* @memberof MyMixins
|
|
*/
|
|
searchchange(v, key) {
|
|
_.set(this, key, this.$u.trim(v));
|
|
}
|
|
}
|