zhaoxiaoqiang
2022-11-29 051957280984f1b519b7312fa177511f95506e7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * @Descripttion: Vue过滤器
 * @Author: TM丶
 * @LastEditors: 小明丶
 * @Date: 2019-04-05 11:32:33
 * @LastEditTime: 2019-08-21 09:57:18
 */
import dataformat from "./dateformat";
 
/**
 * @Descripttion: 格式化电话号码
 * @param {tel} 电话号码 
 * @return: 13388327924 >>> 133****7924 
 */
export function formatPhone(tel) {
    return tel.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
}
 
 
let list = [
    {name:'timeformat',fn:dataformat.format},
    // {name:'phoneformat',fn:formatPhone},
];
 
export default {
    install(Vue,opt){
        list.forEach(item=>{
            Vue.filter(item.name,item.fn);        
        })
    }
}