haomingming 3f40c4c237 优化
2023-04-08 09:51:45 +08:00

49 lines
905 B
JavaScript

// commpents/te_navbar/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
navbarData: { //navbarData 由父页面传递的数据,变量名字自命名
type: Object,
value: {
showCapsule: 1, //是否显示胶囊
title: '标题文字', //导航栏 中间的标题}
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onBack() {
let back_url = this.data.navbarData.back_url;
let back_url_type = this.data.navbarData.back_url_type;
if(back_url){
if(back_url_type == 0){
app.go(back_url);
}else{
wx.reLaunch({
url: back_url,
});
}
}else{
wx.navigateBack();
}
},
onGoHome() {
wx.reLaunch({
url: '/Pages/index/index',
});
},
},
})