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
Prop | Type | Default | Description |
---|---|---|---|
<f7-menu-item> properties | |||
text | string | Menu item text | |
icon-only | boolean | Enable if menu item contains only icon | |
dropdown | boolean | Enable if menu item contains menu dropdown | |
link | boolean | Enable if to render menu item as link (<a> ) element if you don't need to specific href | |
<f7-menu-item> icon related properties | |||
icon-size | string number | Icon size in px | |
icon-color | string | Icon color. One of the default colors | |
icon | string | Custom icon class | |
icon-f7 | string | Name of F7 Icons font icon | |
icon-material | string | Name of Material Icons font icon | |
icon-fa | string | Name of Font Awesome font icon | |
icon-ion | string | Name of Ionicons font icon | |
icon-ios | string | Icon to be used in case of iOS theme is used. Consists of icon family and icon name divided by colon, e.g. f7:home or ion:home | |
icon-md | string | Icon to be used in case of MD theme is used. Consists of icon family and icon name divided by colon, e.g. material:home or fa:home | |
icon-aurora | string | Icon to be used in case of Aurora theme is used. Consists of icon family and icon name divided by colon, e.g. material:home or fa:home | |
<f7-menu-item> navigation/router related properties | |||
href | string boolean | # | URL of the page to load. In case of boolean href="false" it won't add href tag |
target | string | Value of link target attribute, e.g. _blank , _self , etc. | |
view | string | CSS selector of the View to load the page | |
external | boolean | Enable to bypass Framework7's link click handler | |
back | boolean | Enables back navigation link | |
force | boolean | Force page to load and ignore previous page in history (use together with back prop) | |
reload-current | boolean | Reloads new page instead of the currently active one | |
reload-previous | boolean | Replace the previous page in history with the new one from route | |
reload-all | boolean | Load new page and remove all previous pages from history and DOM | |
reload-detail | boolean | Reload Detail page in Master Detail view | |
animate | boolean | Disables pages animation | |
ignore-cache | boolean | Ignores caching | |
route-tab-id | string | Routable Tab id | |
route-props | object | Object with additional props that will be passed to target route component | |
prevent-router | boolean | false | If set, then it won't be processed by Framework7 router |
<f7-menu-item> action related properties | |||
panel-open | string boolean | Defines panel to open. Can be left or right | |
panel-close | boolean | Closes panel on click | |
panel-toggle | boolean | Toggle (open/close) panel on click | |
actions-open | string boolean | CSS selector of the action sheet to open on click | |
actions-close | string boolean | CSS selector of the action sheet to close on click. Or boolean property to close currently opened action sheet | |
popup-open | string boolean | CSS selector of the popup to open on click | |
popup-close | string boolean | CSS selector of the popup to close on click. Or boolean property to close currently opened popup | |
popover-open | string boolean | CSS selector of the popover to open on click | |
popover-close | string boolean | CSS selector of the popover to close on click. Or boolean property to close currently opened popover | |
sheet-open | string boolean | CSS selector of the sheet modal to open on click | |
sheet-close | string boolean | CSS selector of the sheet modal to close on click. Or boolean property to close currently opened sheet modal | |
login-screen-open | string boolean | CSS selector of the login screen to open on click | |
login-screen-close | string boolean | CSS selector of the login screen to close on click. Or boolean property to close currently opened login screen | |
sortable-enable | string boolean | CSS selector of the Sortable list to open on click | |
sortable-disable | string boolean | CSS selector of the Sortable list to close on click. Or boolean property to close currently opened Sortable list | |
sortable-toggle | string boolean | CSS selector of the Sortable list to toggle on click. Or boolean property to toggle currently opened/closed Sortable list | |
searchbar-enable | string boolean | CSS selector of the Expandable Searchbar to be enabled on click. Or boolean property to enable the first found Searchbar | |
searchbar-disable | string boolean | CSS selector of the Expandable Searchbar to be disabled on click. Or boolean property to disable the first found Searchbar | |
searchbar-toggle | string boolean | CSS selector of the Expandable Searchbar to toggle on click. Or boolean property to toggle the first found Searchbar | |
searchbar-clear | string boolean | CSS selector of the Expandable Searchbar to clear on click. Or boolean property to clear the first found Searchbar | |
card-open | string boolean | CSS selector of the expandable card to open on click. Or boolean to open first found expandable card | |
card-close | string boolean | CSS selector of the expandable card to close on click. Or boolean property to close currently opened expandable card | |
card-prevent-open | boolean | Click on element with this prop won't open its parent expandable card | |
menu-close | boolean | Closes Menu dropdown on click | |
<f7-menu-dropdown> properties | |||
content-height | string | CSS value of dropdown height property. Specify only to limit dropdown height if there are a lot of items | |
position | string | Dropdown position, can be left , center or right | |
left | boolean | Same as | |
center | boolean | Same as | |
right | boolean | Same as | |
<f7-menu-dropdown-item> properties | |||
text | string | Menu dropdown item text | |
divider | boolean | Render this item as divider (text will ignored in this case) | |
link | boolean | Enable 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 | |||
href | string boolean | # | URL of the page to load. In case of boolean href="false" it won't add href tag |
target | string | Value of link target attribute, e.g. _blank , _self , etc. | |
view | string | CSS selector of the View to load the page | |
external | boolean | Enable to bypass Framework7's link click handler | |
back | boolean | Enables back navigation link | |
force | boolean | Force page to load and ignore previous page in history (use together with back prop) | |
reload-current | boolean | Reloads new page instead of the currently active one | |
reload-previous | boolean | Replace the previous page in history with the new one from route | |
reload-all | boolean | Load new page and remove all previous pages from history and DOM | |
reload-detail | boolean | Reload Detail page in Master Detail view | |
animate | boolean | Disables pages animation | |
ignore-cache | boolean | Ignores caching | |
route-tab-id | string | Routable Tab id | |
route-props | object | Object with additional props that will be passed to target route component | |
prevent-router | boolean | false | If set, then it won't be processed by Framework7 router |
<f7-menu-dropdown-item> action related properties | |||
panel-open | string boolean | Defines panel to open. Can be left or right | |
panel-close | boolean | Closes panel on click | |
panel-toggle | boolean | Toggle (open/close) panel on click | |
actions-open | string boolean | CSS selector of the action sheet to open on click | |
actions-close | string boolean | CSS selector of the action sheet to close on click. Or boolean property to close currently opened action sheet | |
popup-open | string boolean | CSS selector of the popup to open on click | |
popup-close | string boolean | CSS selector of the popup to close on click. Or boolean property to close currently opened popup | |
popover-open | string boolean | CSS selector of the popover to open on click | |
popover-close | string boolean | CSS selector of the popover to close on click. Or boolean property to close currently opened popover | |
sheet-open | string boolean | CSS selector of the sheet modal to open on click | |
sheet-close | string boolean | CSS selector of the sheet modal to close on click. Or boolean property to close currently opened sheet modal | |
login-screen-open | string boolean | CSS selector of the login screen to open on click | |
login-screen-close | string boolean | CSS selector of the login screen to close on click. Or boolean property to close currently opened login screen | |
sortable-enable | string boolean | CSS selector of the Sortable list to open on click | |
sortable-disable | string boolean | CSS selector of the Sortable list to close on click. Or boolean property to close currently opened Sortable list | |
sortable-toggle | string boolean | CSS selector of the Sortable list to toggle on click. Or boolean property to toggle currently opened/closed Sortable list | |
searchbar-enable | string boolean | CSS selector of the Expandable Searchbar to be enabled on click. Or boolean property to enable the first found Searchbar | |
searchbar-disable | string boolean | CSS selector of the Expandable Searchbar to be disabled on click. Or boolean property to disable the first found Searchbar | |
searchbar-toggle | string boolean | CSS selector of the Expandable Searchbar to toggle on click. Or boolean property to toggle the first found Searchbar | |
searchbar-clear | string boolean | CSS selector of the Expandable Searchbar to clear on click. Or boolean property to clear the first found Searchbar | |
card-open | string boolean | CSS selector of the expandable card to open on click. Or boolean to open first found expandable card | |
card-close | string boolean | CSS selector of the expandable card to close on click. Or boolean property to close currently opened expandable card | |
card-prevent-open | boolean | Click on element with this prop won't open its parent expandable card | |
menu-close | boolean | Closes Menu dropdown on click |
Menu Events
Event | Description |
---|---|
<f7-menu-item> events | |
click | Event will be triggered on menu item click |
menu:opened | Event will be triggered right after menu dropdown will be opened |
menu:closed | Event will be triggered right after menu dropdown will be closed |
<f7-menu-dropdown-item> events | |
click | Event will be triggered on menu dropdown item click |
Examples
Plain Links
<f7-menu>
<f7-menu-item href="#" text="Item 1"></f7-menu-item>
<f7-menu-item href="#" text="Item 2"></f7-menu-item>
<f7-menu-item href="#" icon-f7="edit"></f7-menu-item>
<f7-menu-item href="#" icon-f7="share"></f7-menu-item>
</f7-menu>
Dropdowns
<f7-menu>
<f7-menu-item text="Left" dropdown>
<f7-menu-dropdown left>
<f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
<f7-menu-dropdown-item divider></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
</f7-menu-dropdown>
</f7-menu-item>
<f7-menu-item text="Center" dropdown>
<f7-menu-dropdown center content-height="200px">
<f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
<f7-menu-dropdown-item divider></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 7"></f7-menu-dropdown-item>
<f7-menu-dropdown-item divider></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 8"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 9"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 10"></f7-menu-dropdown-item>
</f7-menu-dropdown>
</f7-menu-item>
<f7-menu-item text="Right" dropdown>
<f7-menu-dropdown right>
<f7-menu-dropdown-item href="#" text="Menu Item 1"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 2"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 3"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 4"></f7-menu-dropdown-item>
<f7-menu-dropdown-item divider></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 5"></f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#" text="Menu Item 6"></f7-menu-dropdown-item>
</f7-menu-dropdown>
</f7-menu-item>
<f7-menu-item style="margin-left: auto" icon-f7="share" dropdown>
<f7-menu-dropdown right>
<f7-menu-dropdown-item href="#">
<span>Share on Facebook</span>
<f7-icon class="margin-left" f7="logo_facebook"></f7-icon>
</f7-menu-dropdown-item>
<f7-menu-dropdown-item href="#">
<span>Share on Twitter</span>
<f7-icon class="margin-left" f7="logo_twitter"></f7-icon>
</f7-menu-dropdown-item>
</f7-menu-dropdown>
</f7-menu-item>
<f7-menu-item href="#" icon-f7="edit"></f7-menu-item>
</f7-menu>