import Vue from 'vue';
import { $formatDate } from '@/utils/util';
let FormatTimeFilter = $formatDate;

Vue.filter('default_avatar', function(url) {
	if (!url) {
		return require('@/assets/icon/default-avatar.png');
	}

	return url;
});

Vue.filter('default_name', function(name) {
	if (!name) {
		return '未命名';
	}

	return name;
});

// 时间
Vue.filter('formatTime', FormatTimeFilter);

/** 一个全局变量的过滤器 value 转label */
import { constFilter } from '@/constant/constantFilter';
Vue.filter('constantfilter', constFilter);
