This commit is contained in:
fengchenchen
2023-08-14 17:10:11 +08:00
commit 37f6ec895d
1145 changed files with 437754 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import Vue from 'vue'
import * as dayjs from 'dayjs'
Vue.filter('NumberFormat', function (value) {
if (!value) {
return '0'
}
// 将整数部分逢三一断
return value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
})
Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
return dayjs(dataStr).format(pattern)
})
Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
return dayjs(dataStr).format(pattern)
})
/** 字符串超长截取省略号显示 */
Vue.filter('ellipsis', function (value, vlength = 25) {
if (!value) {
return ''
}
if (value.length > vlength) {
return value.slice(0, vlength) + '...'
}
return value
})