vue導航菜單元件
Vue元件樣闆 (vue-component-boilerplate)
A Vue.js component to toggle navigation drawer menu container.
一個Vue.js元件,用于切換導航抽屜菜單容器。
View demo View demo2 Download Source 檢視示範 檢視 示範2 下載下傳源
安裝 (Install)
浏覽器 (Browser)
<script src="vue.js"></script>
<script src="vue-nav-drawer.min.js"></script>
npm (npm)
npm install --save vue-nav-drawer
用法 (Usage)
浏覽器 (Browser)
<div id="app">
<nav-drawer-handle></nav-drawer-handle>
<nav-drawer>
MENU LIST
</nav-drawer>
</div>
<script src="vue.js"></script>
<script src="vue-nav-drawer.min.js"></script>
<script>
Vue.use(NavDrawer);
new Vue({
el: '#app'
});
</script>
證監會 (SFC)
<template>
<nav-drawer-handle></nav-drawer-handle>
<nav-drawer>
MENU LIST
</nav-drawer>
</template>
<script>
import { NavDrawer, NavDrawerHandle } from '@inotom/vue-nav-drawer';
export default {
components: {
NavDrawer,
NavDrawerHandle
}
}
</script>
道具 (Props)
NavDrawerHandle (NavDrawerHandle)
Props | Type | Default | Description |
---|---|---|---|
| | | Hamburger menu size(px) |
| | | Hamburger menu line width (normal, thin, bold) |
| | | Hamburger menu line color |
| | | Hamburger menu background color |
| | | Menu label text size |
| | | Add WAI-ARIA role button attribute |
道具 | 類型 | 預設 | 描述 |
---|---|---|---|
| | | 漢堡菜單尺寸(px) |
| | | 漢堡菜單線寬(正常,細,粗體) |
| | | 漢堡菜單線顔色 |
| | | 漢堡菜單背景色 |
| | | 菜單标簽文字大小 |
| | | 添加WAI-ARIA角色按鈕屬性 |
導航抽屜 (NavDrawer)
Props | Type | Default | Description |
---|---|---|---|
| | | Drawer container align left |
| | | Drawer container background color |
| | | Drawer background layer opacity |
| | | Hide close button |
| | | Enable drawer conditional |
| | | Drawer z-index |
| | | Add WAI-ARIA role button attribute to close icon |
道具 | 類型 | 預設 | 描述 |
---|---|---|---|
| | | 抽屜容器向左對齊 |
| | | 抽屜容器背景色 |
| | | 抽屜背景層不透明度 |
| | | 隐藏關閉按鈕 |
| | | 啟用條件抽屜 |
| | | 抽屜Z索引 |
| | | 将WAI-ARIA角色按鈕屬性添加到關閉圖示 |
翻譯自: https://vuejsexamples.com/a-vue-js-component-to-toggle-navigation-drawer-menu-container/
vue導航菜單元件