import Vue from 'vue'
import CONSTANT from '@/constant'
import { $formatDate } from '@/utils/util'
// let FormatTimeFilter = $formatDate
// export { FormatTimeFilter }
// import { FormatTimeFilter } from '@/filters/index'
Vue.filter('formatTime', $formatDate)

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

Vue.filter('formatPrice', function(val) {
	if (!val) {
		return 0.00
	}
	return val.toFixed(2)
})

Vue.filter('default_img', function(url) {
	if (!url) {
		return require(`@/static/images/default-img.png`)
	}
	return url
})

Vue.filter('default_avatar', function(url) {
	if (!url) {
		console.log('url')
		return require('@/static/images/user/attr-default.png')
	}
	return url
})
