You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
281 B

import Vue from 'vue'
export const truncate = function (text, length, clamp) {
text = text || ''
clamp = clamp || '...'
length = length || 30
if (text.length <= length) {
return text
}
return text.substring(0, length) + clamp
}
Vue.filter('truncate', truncate)