// タブコンポーネント Alpine.data('auditHistoryTabs', () => ({ activeTab: 'all', tabCounts: { all: 0, activity: 0, audit: 0 }, initializeTabs() { // 検索実行時のイベントリスナー this.$watch('activeTab', (newTab) => { this.$dispatch('tab-changed', newTab); }); }, switchTab(tab) { if (this.activeTab !== tab) { this.activeTab = tab; } }, updateTabCounts(counts) { this.tabCounts = { ...this.tabCounts, ...counts }; } }));