diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-15 20:26:02 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-15 20:26:02 +0900 |
| commit | c2b3436770eef87b82626ca785449e38b9af5c8a (patch) | |
| tree | 3d28e4dfe8915e6d0cf96268f65c1bca518e65c7 /src/client/components | |
| parent | update mfm-js (diff) | |
| download | sharkey-c2b3436770eef87b82626ca785449e38b9af5c8a.tar.gz sharkey-c2b3436770eef87b82626ca785449e38b9af5c8a.tar.bz2 sharkey-c2b3436770eef87b82626ca785449e38b9af5c8a.zip | |
better list rendering
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/date-separated-list.vue | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/components/date-separated-list.vue b/src/client/components/date-separated-list.vue index 433655d6ed..833cdfc898 100644 --- a/src/client/components/date-separated-list.vue +++ b/src/client/components/date-separated-list.vue @@ -24,11 +24,9 @@ export default defineComponent({ methods: { focus() { this.$slots.default[0].elm.focus(); - } - }, + }, - render() { - const getDateText = (time: string) => { + getDateText(time: string) { const date = new Date(time).getDate(); const month = new Date(time).getMonth() + 1; return this.$t('monthAndDay', { @@ -36,9 +34,13 @@ export default defineComponent({ day: date.toString() }); } + }, + render() { const noGap = [...document.querySelectorAll('._noGap_')].some(el => el.contains(this.$parent.$el)); + if (this.items.length === 0) return; + return h(this.$store.state.animation ? TransitionGroup : 'div', this.$store.state.animation ? { class: 'sqadhkmv' + (noGap ? ' _block' : ''), name: 'list', @@ -72,10 +74,10 @@ export default defineComponent({ class: 'icon', icon: faAngleUp, }), - getDateText(item.createdAt) + this.getDateText(item.createdAt) ]), h('span', [ - getDateText(this.items[i + 1].createdAt), + this.getDateText(this.items[i + 1].createdAt), h(FontAwesomeIcon, { class: 'icon', icon: faAngleDown, |