From c30f02ae4c046b73b94c437be5912fa5e94684b7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 10 Aug 2021 15:07:15 +0900 Subject: Update vue to 3.2.1 --- src/client/scripts/paging.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/client/scripts') diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts index 194c2e8003..1da518efa1 100644 --- a/src/client/scripts/paging.ts +++ b/src/client/scripts/paging.ts @@ -201,7 +201,11 @@ export default (opts) => ({ if (isBottom) { // オーバーフローしたら古いアイテムは捨てる if (this.items.length >= opts.displayLimit) { - this.items = this.items.slice(-opts.displayLimit); + // このやり方だとVue 3.2以降アニメーションが動かなくなる + //this.items = this.items.slice(-opts.displayLimit); + while (this.items.length >= opts.displayLimit) { + this.items.shift(); + } this.more = true; } } @@ -216,7 +220,11 @@ export default (opts) => ({ // オーバーフローしたら古いアイテムは捨てる if (this.items.length >= opts.displayLimit) { - this.items = this.items.slice(0, opts.displayLimit); + // このやり方だとVue 3.2以降アニメーションが動かなくなる + //this.items = this.items.slice(0, opts.displayLimit); + while (this.items.length >= opts.displayLimit) { + this.items.pop(); + } this.more = true; } } else { -- cgit v1.2.3-freya