Menu - 图1

Menu Vue Component

Menu component not so often seen in mobile apps. But it is proven to be extremely helpful when you need controls on top of the map, images, some text/code editor, etc.

Menu Vue component represents Menu component.

Menu Components

There are following components included:

  • f7-menu
  • f7-menu-item
  • f7-menu-dropdown
  • f7-menu-dropdown-item

Menu Properties

PropTypeDefaultDescription
<f7-menu-item> properties
textstringMenu item text
icon-onlybooleanEnable if menu item contains only icon
dropdownbooleanEnable if menu item contains menu dropdown
linkbooleanEnable if to render menu item as link (<a>) element if you don’t need to specific href
<f7-menu-item> icon related properties
icon-sizestring
number
Icon size in px
icon-colorstringIcon color. One of the default colors
iconstringCustom icon class
icon-f7stringName of F7 Icons font icon
icon-materialstringName of Material Icons font icon
icon-iosstringIcon to be used in case of iOS theme is used. Consists of icon family and icon name divided by colon, e.g. f7:home
icon-mdstringIcon to be used in case of MD theme is used. Consists of icon family and icon name divided by colon, e.g. material:home
icon-aurorastringIcon to be used in case of Aurora theme is used. Consists of icon family and icon name divided by colon, e.g. material:home
<f7-menu-item> navigation/router related properties
hrefstring
boolean
#URL of the page to load. In case of boolean href=”false” it won’t add href tag
targetstringValue of link target attribute, e.g. _blank, _self, etc.
viewstringCSS selector of the View to load the page. Or current to load in current view.
externalbooleanEnable to bypass Framework7’s link click handler
backbooleanEnables back navigation link
forcebooleanForce page to load and ignore previous page in history (use together with back prop)
reload-currentbooleanReloads new page instead of the currently active one
reload-previousbooleanReplace the previous page in history with the new one from route
reload-allbooleanLoad new page and remove all previous pages from history and DOM
reload-detailbooleanReload Detail page in Master Detail view
animatebooleanDisables pages animation
transitionstringName of the custom page transition
ignore-cachebooleanIgnores caching
route-tab-idstringRoutable Tab id
route-propsobjectObject with additional props that will be passed to target route component
prevent-routerbooleanfalseIf set, then it won’t be processed by Framework7 router
<f7-menu-item> action related properties
panel-openstring
boolean
CSS selector of panel to open on click. Or can be left or right if there is only left or right panel in DOM.
panel-closestring
boolean
Closes panel on click
panel-togglestring
boolean
CSS selector of panel to toggle on click. Or can be left or right if there is only left or right panel in DOM.
actions-openstring
boolean
CSS selector of the action sheet to open on click
actions-closestring
boolean
CSS selector of the action sheet to close on click. Or boolean property to close currently opened action sheet
popup-openstring
boolean
CSS selector of the popup to open on click
popup-closestring
boolean
CSS selector of the popup to close on click. Or boolean property to close currently opened popup
popover-openstring
boolean
CSS selector of the popover to open on click
popover-closestring
boolean
CSS selector of the popover to close on click. Or boolean property to close currently opened popover
sheet-openstring
boolean
CSS selector of the sheet modal to open on click
sheet-closestring
boolean
CSS selector of the sheet modal to close on click. Or boolean property to close currently opened sheet modal
login-screen-openstring
boolean
CSS selector of the login screen to open on click
login-screen-closestring
boolean
CSS selector of the login screen to close on click. Or boolean property to close currently opened login screen
sortable-enablestring
boolean
CSS selector of the Sortable list to open on click
sortable-disablestring
boolean
CSS selector of the Sortable list to close on click. Or boolean property to close currently opened Sortable list
sortable-togglestring
boolean
CSS selector of the Sortable list to toggle on click. Or boolean property to toggle currently opened/closed Sortable list
searchbar-enablestring
boolean
CSS selector of the Expandable Searchbar to be enabled on click. Or boolean property to enable the first found Searchbar
searchbar-disablestring
boolean
CSS selector of the Expandable Searchbar to be disabled on click. Or boolean property to disable the first found Searchbar
searchbar-togglestring
boolean
CSS selector of the Expandable Searchbar to toggle on click. Or boolean property to toggle the first found Searchbar
searchbar-clearstring
boolean
CSS selector of the Expandable Searchbar to clear on click. Or boolean property to clear the first found Searchbar
card-openstring
boolean
CSS selector of the expandable card to open on click. Or boolean to open first found expandable card
card-closestring
boolean
CSS selector of the expandable card to close on click. Or boolean property to close currently opened expandable card
card-prevent-openbooleanClick on element with this prop won’t open its parent expandable card
menu-closebooleanCloses Menu dropdown on click
<f7-menu-dropdown> properties
content-heightstringCSS value of dropdown height property. Specify only to limit dropdown height if there are a lot of items
positionstringDropdown position, can be left, center or right
leftbooleanSame as left
centerbooleanSame as center
rightbooleanSame as right
<f7-menu-dropdown-item> properties
textstringMenu dropdown item text
dividerbooleanRender this item as divider (text will ignored in this case)
linkbooleanEnable if to render menu item as link (<a>) element if you don’t need to specific href
<f7-menu-dropdown-item> navigation/router related properties
hrefstring
boolean
#URL of the page to load. In case of boolean href=”false” it won’t add href tag
targetstringValue of link target attribute, e.g. _blank, _self, etc.
viewstringCSS selector of the View to load the page. Or current to load in current view.
externalbooleanEnable to bypass Framework7’s link click handler
backbooleanEnables back navigation link
forcebooleanForce page to load and ignore previous page in history (use together with back prop)
reload-currentbooleanReloads new page instead of the currently active one
reload-previousbooleanReplace the previous page in history with the new one from route
reload-allbooleanLoad new page and remove all previous pages from history and DOM
reload-detailbooleanReload Detail page in Master Detail view
animatebooleanDisables pages animation
transitionstringName of the custom page transition
ignore-cachebooleanIgnores caching
route-tab-idstringRoutable Tab id
route-propsobjectObject with additional props that will be passed to target route component
prevent-routerbooleanfalseIf set, then it won’t be processed by Framework7 router
<f7-menu-dropdown-item> action related properties
panel-openstring
boolean
CSS selector of panel to open on click. Or can be left or right if there is only left or right panel in DOM.
panel-closestring
boolean
Closes panel on click
panel-togglestring
boolean
CSS selector of panel to toggle on click. Or can be left or right if there is only left or right panel in DOM.
actions-openstring
boolean
CSS selector of the action sheet to open on click
actions-closestring
boolean
CSS selector of the action sheet to close on click. Or boolean property to close currently opened action sheet
popup-openstring
boolean
CSS selector of the popup to open on click
popup-closestring
boolean
CSS selector of the popup to close on click. Or boolean property to close currently opened popup
popover-openstring
boolean
CSS selector of the popover to open on click
popover-closestring
boolean
CSS selector of the popover to close on click. Or boolean property to close currently opened popover
sheet-openstring
boolean
CSS selector of the sheet modal to open on click
sheet-closestring
boolean
CSS selector of the sheet modal to close on click. Or boolean property to close currently opened sheet modal
login-screen-openstring
boolean
CSS selector of the login screen to open on click
login-screen-closestring
boolean
CSS selector of the login screen to close on click. Or boolean property to close currently opened login screen
sortable-enablestring
boolean
CSS selector of the Sortable list to open on click
sortable-disablestring
boolean
CSS selector of the Sortable list to close on click. Or boolean property to close currently opened Sortable list
sortable-togglestring
boolean
CSS selector of the Sortable list to toggle on click. Or boolean property to toggle currently opened/closed Sortable list
searchbar-enablestring
boolean
CSS selector of the Expandable Searchbar to be enabled on click. Or boolean property to enable the first found Searchbar
searchbar-disablestring
boolean
CSS selector of the Expandable Searchbar to be disabled on click. Or boolean property to disable the first found Searchbar
searchbar-togglestring
boolean
CSS selector of the Expandable Searchbar to toggle on click. Or boolean property to toggle the first found Searchbar
searchbar-clearstring
boolean
CSS selector of the Expandable Searchbar to clear on click. Or boolean property to clear the first found Searchbar
card-openstring
boolean
CSS selector of the expandable card to open on click. Or boolean to open first found expandable card
card-closestring
boolean
CSS selector of the expandable card to close on click. Or boolean property to close currently opened expandable card
card-prevent-openbooleanClick on element with this prop won’t open its parent expandable card
menu-closebooleanCloses Menu dropdown on click

Menu Events

EventDescription
<f7-menu-item> events
clickEvent will be triggered on menu item click
menu:openedEvent will be triggered right after menu dropdown will be opened
menu:closedEvent will be triggered right after menu dropdown will be closed
<f7-menu-dropdown-item> events
clickEvent will be triggered on menu dropdown item click

Examples

Plain Links

  1. <f7-menu>
  2. <f7-menu-item href="#" text="Item 1"></f7-menu-item>
  3. <f7-menu-item href="#" text="Item 2"></f7-menu-item>
  4. <f7-menu-item href="#" icon-f7="edit"></f7-menu-item>
  5. <f7-menu-item href="#" icon-f7="share"></f7-menu-item>
  6. </f7-menu>

Dropdowns

  1. <f7-menu>
  2. <f7-menu-item text="Left" dropdown>
  3. <f7-menu-dropdown left>
  4. <f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
  5. <f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
  6. <f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
  7. <f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
  8. <f7-menu-dropdown-item divider></f7-menu-dropdown-item>
  9. <f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
  10. <f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
  11. </f7-menu-dropdown>
  12. </f7-menu-item>
  13. <f7-menu-item text="Center" dropdown>
  14. <f7-menu-dropdown center content-height="200px">
  15. <f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
  16. <f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
  17. <f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
  18. <f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
  19. <f7-menu-dropdown-item divider></f7-menu-dropdown-item>
  20. <f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
  21. <f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
  22. <f7-menu-dropdown-item href="#" text="Menu Item 7"></f7-menu-dropdown-item>
  23. <f7-menu-dropdown-item divider></f7-menu-dropdown-item>
  24. <f7-menu-dropdown-item href="#" text="Menu Item 8"></f7-menu-dropdown-item>
  25. <f7-menu-dropdown-item href="#" text="Menu Item 9"></f7-menu-dropdown-item>
  26. <f7-menu-dropdown-item href="#" text="Menu Item 10"></f7-menu-dropdown-item>
  27. </f7-menu-dropdown>
  28. </f7-menu-item>
  29. <f7-menu-item text="Right" dropdown>
  30. <f7-menu-dropdown right>
  31. <f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
  32. <f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
  33. <f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
  34. <f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
  35. <f7-menu-dropdown-item divider></f7-menu-dropdown-item>
  36. <f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
  37. <f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
  38. </f7-menu-dropdown>
  39. </f7-menu-item>
  40. <f7-menu-item style="margin-left: auto" icon-f7="share" dropdown>
  41. <f7-menu-dropdown right>
  42. <f7-menu-dropdown-item href="#">
  43. <span>Share on Facebook</span>
  44. <f7-icon class="margin-left" f7="logo_facebook"></f7-icon>
  45. </f7-menu-dropdown-item>
  46. <f7-menu-dropdown-item href="#">
  47. <span>Share on Twitter</span>
  48. <f7-icon class="margin-left" f7="logo_twitter"></f7-icon>
  49. </f7-menu-dropdown-item>
  50. </f7-menu-dropdown>
  51. </f7-menu-item>
  52. <f7-menu-item href="#" icon-f7="edit"></f7-menu-item>
  53. </f7-menu>

← Login Screen

Messagebar →