Panel / Side Panels - 图1

Panel Vue Component

Panel Vue component represents Side Panels component.

Panel Components

There are following components included:

  • **f7-panel** - Panel element

Panel Properties

PropTypeDefaultDescription
sidestringPanel side. Could be left or right
leftbooleanShortcut prop for side=”left”
rightbooleanShortcut prop for side=”right”
effectstringPanel effect. Could be cover or reveal
coverbooleanShortcut prop for effect=”cover”
revealbooleanShortcut prop for effect=”reveal”
openedbooleanAllows to open/close panel and set its initial state

Panel Methods

.open(animate)Open panel
.close(animate)Close panel

Panel Events

EventDescription
panel:openEvent will be triggered when Panel starts its opening animation
panel:openedEvent will be triggered after Panel completes its opening animation
panel:closeEvent will be triggered when Panel starts its closing animation
panel:closedEvent will be triggered after Panel completes its closing animation
panel:backdrop-clickEvent will be triggered when the panel backdrop is clicked
panel:swipeEvent will be triggered for swipe panels during touch swipe action
panel:swipeopenEvent will be triggered in the very beginning of opening it with swipe
panel:breakpointEvent will be triggered when it becomes visible/hidden when app width matches its breakpoint

Open And Close Panel

You can control panel state, open and closing it:

  • using Panel API
  • by passing true or false to its opened prop
  • by clicking on Link or Button with relevant panel-open property (to open it) and panel-close property to close it

Access To Panel Instance

You can access Panel initialized instance by accessing **.f7Panel** component’s property.

Examples

  1. <f7-app>
  2. <!-- Left Panel with Reveal effect -->
  3. <f7-panel left reveal>
  4. <f7-view>
  5. <f7-page>
  6. <f7-block>Left panel content</f7-block>
  7. </f7-view>
  8. </f7-panel>
  9. <!-- Right Panel with Cover effect and dark layout theme -->
  10. <f7-panel right theme-dark>
  11. <f7-view>
  12. <f7-page>
  13. <f7-block>Right panel content</f7-block>
  14. </f7-view>
  15. </f7-panel>
  16. <!-- Main view -->
  17. <f7-view main>
  18. <f7-page>
  19. <f7-navbar title="Panel"></f7-navbar>
  20. <f7-block class="row">
  21. <f7-col>
  22. <f7-button raised panel-open="left">Open left panel</f7-button>
  23. </f7-col>
  24. <f7-col>
  25. <f7-button raised panel-open="right">Open right panel</f7-button>
  26. </f7-col>
  27. </f7-block>
  28. </f7-page>
  29. </f7-view>
  30. </f7-app>