mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
chore: Add formatting for the view count (#6447)
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
</router-link>
|
||||
</td>
|
||||
<td>
|
||||
<span class="fs-small">
|
||||
{{ views || 0 }}
|
||||
<span class="fs-small" :title="formattedViewCount">
|
||||
{{ readableViewCount }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
@@ -95,6 +95,15 @@ export default {
|
||||
lastUpdatedAt() {
|
||||
return this.dynamicTime(this.updatedAt);
|
||||
},
|
||||
formattedViewCount() {
|
||||
return Number(this.views || 0).toLocaleString('en');
|
||||
},
|
||||
readableViewCount() {
|
||||
return new Intl.NumberFormat('en-US', {
|
||||
notation: 'compact',
|
||||
compactDisplay: 'short',
|
||||
}).format(this.views || 0);
|
||||
},
|
||||
articleAuthorName() {
|
||||
return this.author.name;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user