123456789101112131415161718192021222324252627282930 |
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
- currentType: '1'
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onShow() {
- if (typeof this.getTabBar === 'function') {
- this.getTabBar().setData({
- selected: 1
- })
- }
- },
- selectType({
- target
- }) {
- if (target.dataset.type) {
- this.setData({
- currentType: target.dataset.type
- })
- }
- }
- })
|