Files

41 lines
774 B
TypeScript
Raw Permalink Normal View History

Component({
options: { multipleSlots: true },
/**
*
*/
properties: {
active: {
type: String,
value: "",
},
},
/**
*
*/
data: {
list: [
{ value: "index", 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) {
wx.reLaunch({ url: this.data.pages[e.detail.value] });
}
},
},
});