backup: snapshot before optimization
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
var themeMod = require('../utils/theme')
|
||||
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,
|
||||
themeStyle: ''
|
||||
},
|
||||
|
||||
lifetimes: {
|
||||
attached: function () {
|
||||
var theme = themeMod.getCurrentTheme()
|
||||
this.setData({ themeStyle: themeMod.getThemeStyle(theme) })
|
||||
}
|
||||
},
|
||||
|
||||
pageLifetimes: {
|
||||
show: function () {
|
||||
var theme = themeMod.getCurrentTheme()
|
||||
this.setData({ themeStyle: themeMod.getThemeStyle(theme) })
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
switchTab: function (e) {
|
||||
var index = e.currentTarget.dataset.index
|
||||
var pages = [
|
||||
'/pages/index/index',
|
||||
'/pages/records/records',
|
||||
'/pages/settings/settings'
|
||||
]
|
||||
|
||||
if (index === this.data.selected) return
|
||||
|
||||
wx.switchTab({ url: pages[index] })
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user