From 9c0728a660b51143f64407592f3893cc892c88e4 Mon Sep 17 00:00:00 2001 From: sunhao Date: Sun, 14 Jul 2024 16:15:10 +0800 Subject: [PATCH] * tabs: refactor. --- lib/tabs/src/vanilla/tabs.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tabs/src/vanilla/tabs.ts b/lib/tabs/src/vanilla/tabs.ts index 6cf2f32d4b..fc3488bc5a 100644 --- a/lib/tabs/src/vanilla/tabs.ts +++ b/lib/tabs/src/vanilla/tabs.ts @@ -9,7 +9,7 @@ const ACTIVE_CLASS = 'active'; export class Tabs extends Component<{}, {show: [target: string], shown: [target: string]}> { static NAME = 'Tabs'; - #timer = 0; + _timer = 0; active(selector?: Selector) { const $nav = this.$element; @@ -39,13 +39,13 @@ export class Tabs extends Component<{}, {show: [target: string], shown: [target: $activePane.addClass('active').trigger('show', [name]); this.emit('show', name); - if (this.#timer) { - clearTimeout(this.#timer); + if (this._timer) { + clearTimeout(this._timer); } - this.#timer = setTimeout(() => { + this._timer = setTimeout(() => { $activePane.addClass('in').trigger('shown', [name]); this.emit('shown', name); - this.#timer = 0; + this._timer = 0; }, 10) as unknown as number; } }