export const ellipsisFileName = function(str) {
const strLength = str.length
let data = []
if (strLength > 8) {
data.push(str.substr(0, strLength - 8))
data.push(str.substr(-8))
} else {
data.push(str)
}
return data
}
首先拿到字符串的长度 , 如果长度>8的话 , 把字符串分成两块 , 放到新数组中