View Vue Component

View - is a separate visual part of app with its own settings, navigation and history. Each view also may have different navbar and toolbar layouts, different styles. So it is some kind of app in app. Such kind of functionality allows you easily manipulate each part of your app.

View Vue component represents Framework7's View component.

View Components

There are following components included:

  • f7-view - single View-router component
  • f7-views - wrapper element for multiple views used as Tabs

View Properties

PropTypeDefaultDescription
<f7-view> properties
initbooleantrueInitializes View automatically
tabbooleanUses View as Tab
tab-activebooleanDefines View-Tab as currently active Tab
View Vue component also accepts all View Parameters. All of them can be passed via separate props on <f7-view> component
<f7-views> properties
tabsbooleanUses Views as Tabs wrapper container

View Events

Swipe-back related events are available only in iOS theme.

EventDescription
view:initEvent will be triggered on View initialization
view:resizeEvent will be triggered on Master Detail resize (when masterDetailResizable enabled)
swipeback:moveEvent will be triggered during swipe back move
swipeback:beforechangeEvent will be triggered right before swipe back animation to previous page when you release it
swipeback:afterchangeEvent will be triggered after swipe back animation to previous page when you release it
swipeback:beforeresetEvent will be triggered right before swipe back animation to current page when you release it
swipeback:afterresetEvent will be triggered after swipe back animation to current page when you release it
tab:showEvent will be triggered when View-Tab becomes visible/active
tab:hideEvent will be triggered when View-Tab becomes invisible/inactive

Access To View Instance

If you use automatic initalization to init the View (with init:true prop) and need to use View API (like router) you can access its initialized instance:

  • if you have passed name property (e.g. "left") you can access it like f7.views.left
  • main view (with main="true" prop) is always accessible via f7.views.main

Examples

Minimal layout

<f7-view main>
  ...
</f7-view>

<!-- Renders to: -->

<div class="view view-main">
  ...
</div>

Views As Tabs

<f7-app>
  ...
  <f7-views tabs>
    <f7-view id="tab-1" main tab tab-active>...</f7-view>
    <f7-view id="tab-2" tab>...</f7-view>
  </f7-views>
  ...
</f7-app>

<!-- Renders to: -->
<div class="framework7-root">
  <div class="views tabs">
    <div class="view view-main tab tab-active" id="tab-1">...</div>
    <div class="view tab" id="tab-2">...</div>
  </div>
</div>

With parameters

<f7-view
  url="/home/"
  :animate="false"
  :ios-dynamic-navbar="false"
  :browser-history="true"
>
  ...
</f7-view>