- Created `pages/list` for managing and displaying to-do tasks. - Created `pages/settings` as a placeholder for application settings. - Updated `pages/index` for a refreshed layout with navigation to "Tasks" and "Settings". - Integrated custom tab bar across all pages for seamless transitions.
19 lines
439 B
TypeScript
19 lines
439 B
TypeScript
// pages/settings/settings.ts
|
|
Component({
|
|
data: {
|
|
activeTab: 'settings', // For tab bar
|
|
},
|
|
methods: {
|
|
onTabChange(e: any) {
|
|
const targetPage = e.detail.value;
|
|
if (targetPage === 'home') {
|
|
wx.switchTab({ url: '/pages/index/index' });
|
|
} else if (targetPage === 'list') {
|
|
wx.switchTab({ url: '/pages/list/list' });
|
|
}
|
|
// No need to navigate if already on 'settings'
|
|
},
|
|
},
|
|
});
|
|
|