Framework7选项卡模板路由

时间:2019-04-13 05:35:14

标签: routing html-framework-7

我的项目正在使用framework7模板的选项卡式视图。我制作了此订单按钮,因此当我按下它时,它会重定向到“历史记录”标签。我尝试使用app.views.main.router.navigate('/catalog/');,但确实将主视图更改为目录视图,但未更改为目录选项卡。它将主页更改为目录视图

我的代码

path: '/order/',
url: './pages/order.html',
on: {
    pageBeforeIn: function (event, page) {
      // do something before page gets into the view
      //insert picker data from & to value
      var pickerFrom = app.picker.create({
        inputEl: '#from-picker',
        cols: [
          {
            textAlign: 'center',
            values: ['Dukuh Pakis','Dukuh Kupang']
           }
         ]
      });
      var pickerTo = app.picker.create({
        inputEl: '#to-picker',
        cols: [
          {
            textAlign: 'center',
            values: ['Dukuh Pakis','Dukuh Kupang']
          }
        ]
      });
    },
    pageInit: function (event, page) {
      // do something when page initialized
      //order button$$('#harga').html('ggag');
      $$('#pesan').on('click',function(){
        var from = $$('#from-picker').val();
        var to = $$('#to-picker').val();
         app.views.main.router.navigate('/catalog/');
      });
    },
   }

0 个答案:

没有答案