Files
FreeERP.Applet/miniprogram/pages/components/tab-bar-plugin/tab-bar-plugin.ts

44 lines
806 B
TypeScript
Raw Normal View History

Component({
options: { multipleSlots: true },
/**
*
*/
properties: {
active: {
type: String,
value: "home",
},
},
/**
*
*/
data: {
list: [
{ value: "home", label: "首页", icon: "home" },
{ value: "scan", label: "扫码", icon: "scan" },
{ value: "my", label: "我的", icon: "user" },
],
pages: {
index: "/pages/index/index",
scan: "/pages/processEntry/processEntry",
my: "/pages/my/my",
} as Record<string, string>,
},
/**
*
*/
methods: {
onChange(e: any) {
if (e.detail.value == this.data.active) {
return;
}
wx.reLaunch({
url: this.data.pages[e.detail.value],
});
},
},
});