refactor pages struct
This commit is contained in:
33
miniprogram/pages/main/tabs/other/index.ts
Normal file
33
miniprogram/pages/main/tabs/other/index.ts
Normal file
@ -0,0 +1,33 @@
|
||||
type NavItem = {
|
||||
title: string;
|
||||
icon: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
interface OtherData {
|
||||
navList: NavItem[];
|
||||
}
|
||||
|
||||
Page({
|
||||
data: <OtherData>{
|
||||
navList: [
|
||||
{
|
||||
title: "备忘录",
|
||||
icon: "task-checked",
|
||||
url: "/pages/main/other/portfolio/index"
|
||||
},
|
||||
{
|
||||
title: "专拍",
|
||||
icon: "face-retouching",
|
||||
url: "/pages/main/other/portfolio/index"
|
||||
}
|
||||
],
|
||||
},
|
||||
onNavTap(e: WechatMiniprogram.BaseEvent) {
|
||||
const { url } = e.currentTarget.dataset as { url?: string };
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user