/*
 * @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));
  }
}
