2018-08-12 17:35:13 +08:00

38 lines
719 B
JavaScript

import Page from '../../common/page';
import config from './config';
Page({
data: {
items: [
{
// 导航名称
text: '所有城市',
// 该导航下所有的可选项
children: [...config.pro1, ...config.pro2]
}, {
// 导航名称
text: config.pro1Name,
// 该导航下所有的可选项
children: config.pro1
}, {
text: config.pro2Name,
children: config.pro2
}
],
mainActiveIndex: 0,
activeId: 1002
},
onNavClick({ detail }) {
this.setData({
mainActiveIndex: detail.index || 0
});
},
onItemClick({ detail }) {
this.setData({
activeId: detail.id
});
}
});