You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
976 B
59 lines
976 B
// components/navbar/index.js
|
|
const App = getApp();
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
},
|
|
externalClasses: ['custom-class'],
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
pageName:String,
|
|
showNav: {
|
|
type: Boolean,
|
|
value: true
|
|
},
|
|
bgColor:{
|
|
type: String,
|
|
value: '#fff'
|
|
},
|
|
iconColor:{
|
|
type: String,
|
|
value: '#000'
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
|
|
},
|
|
lifetimes: {
|
|
attached: function () {
|
|
this.setData({
|
|
navHeight: App.globalData.navHeight,
|
|
navTop: App.globalData.navTop
|
|
})
|
|
}
|
|
},
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
//回退
|
|
_navBack: function () {
|
|
wx.navigateBack({
|
|
delta: 1
|
|
})
|
|
},
|
|
//回主页
|
|
_toIndex: function () {
|
|
wx.navigateTo({
|
|
url: '/pages/index/index'
|
|
})
|
|
},
|
|
}
|
|
})
|
|
|