44 lines
806 B
TypeScript
44 lines
806 B
TypeScript
|
|
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],
|
||
|
|
});
|
||
|
|
},
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|