mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
Merge pull request #4314 from Ocelot-Social-Community/4253-long-hashtags-not-visible
fix: 🐛 Fix Wrong Truncation Of Hashtags In Admin List Via Adding 'truncateStr'
This commit is contained in:
commit
8bd34f9de7
@ -5,7 +5,7 @@
|
||||
<template #index="scope">{{ scope.index + 1 }}.</template>
|
||||
<template #id="scope">
|
||||
<nuxt-link :to="{ path: '/', query: { hashtag: encodeURI(scope.row.id) } }">
|
||||
<b>#{{ scope.row.id | truncate(20) }}</b>
|
||||
<b>#{{ scope.row.id | truncateStr(20) }}</b>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
</ds-table>
|
||||
|
||||
@ -24,6 +24,7 @@ export default ({ app = {} }) => {
|
||||
}
|
||||
return accounting.formatNumber(value || 0, precision, thousands, decimals)
|
||||
},
|
||||
// doesn't truncate in the middle of words
|
||||
truncate: (value = '', length = -1) => {
|
||||
if (!value || typeof value !== 'string' || value.length <= 0) {
|
||||
return ''
|
||||
@ -33,6 +34,7 @@ export default ({ app = {} }) => {
|
||||
}
|
||||
return trunc(value, length).html
|
||||
},
|
||||
// truncates in the middle of words
|
||||
truncateStr: (value = '', length = -1) => {
|
||||
if (!value || typeof value !== 'string' || value.length <= 0) {
|
||||
return ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user