Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

How to change tabbar in page components ?

  • this is my code

          <div class="center">{{title}}</div>
        <v-ons-tabbar position="auto">
          <template slot="pages">
              <component :is="page"></component>
          <v-ons-tab v-for="(pageItem,pageIndex) in pageList"
                     :active="page === pageItem.pageComponents"

    and I want to change tabbar in page components,How to do this?

  • Onsen UI

    @丶JavaScript Do you mean changing the current page from a button inside pages? You’ll need to pass a prop function to modify your page variable or emit an event to do it.

  • @Fran-Diox Do u mean add a prop function in ons-tabbar to change current page?

  • Onsen UI

    @丶JavaScript said:

    <component :is=“page” :set-page="() => showPage(…)"></component>

    <component :is=“page” @page=“showPage(…)”></component>

    You pass props or event handler to the page components so you can communicate with them.