How i can put in router the init page (v2)


#1

i have this structure:

    <div id="app">
         <div class="views tabs">
              <div id="tab1" class="view view-main tab tab-active">
                   <div class="page" data-name="page01"></div>
              </div>

              <div id="tab2" class="view view-map tab""></div> 
               .
               .
               .
         </div>
    </div> 

how i can put in router my first tab (data-name=“page01”)?

routes: [
  {
    name: 'anotherPage',
    path: '/anotherPage/',
    url: './anotherPage.html',
    on: {
      pageInit: function (e, page) {
        functionX ();
      },
    }
  },
],

THANKS


#2

Look how it is done here https://github.com/framework7io/framework7-template-tabs/blob/master/www/index.html#L176. Just leave your #tab1 view empty, and pass its url on View init like here https://github.com/framework7io/framework7-template-tabs/blob/master/www/js/app.js#L49

And make sure you have required route in your Routes