Skip to content

Commit

Permalink
feat: drawer 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed May 8, 2018
1 parent bb2010e commit c8d7dcb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .postcssrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
'not ie < 10'
]
}),
require('cssnano')
require('cssnano')({
safe: true
})
]
};
3 changes: 3 additions & 0 deletions docs/src/configs/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export default {
}, {
name: 'Divider',
path: '/divider'
}, {
name: 'Drawer',
path: '/drawer'
}, {
name: 'Grid List',
path: '/grid-list'
Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/zh-CN/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
</mu-flex>
<mu-dialog title="Phone Ringtone" width="360" scrollable :open.sync="openScroll">
<mu-list>
<mu-list-item v-for="option in options">
<mu-list-item :key="option" v-for="option in options">
<mu-list-item-content>
<mu-radio :label="option" :value="option" v-model="ringtone"></mu-radio>
</mu-list-item-content>
Expand Down
66 changes: 66 additions & 0 deletions docs/src/docs/zh-CN/drawer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## 抽屉导航

`mu-drawer` 从侧边弹出的对话框。

## 示例

:::demo
```html
<mu-container>
<mu-flex justify-content="center" align-items="center">
<mu-switch style="margin-left: 16px" v-model="docked" label="docked"></mu-switch>
<mu-radio style="margin-left: 16px" v-model="position" value="left" label="left"></mu-radio>
<mu-radio style="margin-left: 16px" v-model="position" value="right" label="right"></mu-radio>
<mu-button color="primary" style="margin-left: 16px" @click="open = !open">
toggle
</mu-button>
</mu-flex>
<mu-drawer :open.sync="open" :docked="docked" :right="position === 'right'">
<mu-list>
<mu-list-item button>
<mu-list-item-title>Menu Item 1</mu-list-item-title>
</mu-list-item>
<mu-list-item button>
<mu-list-item-title>Menu Item 2</mu-list-item-title>
</mu-list-item>
<mu-list-item button>
<mu-list-item-title @click="open = false">Close</mu-list-item-title>
</mu-list-item>
</mu-list>
</mu-drawer>
<mu-container>
<script>
export default {
data () {
return {
docked: false,
open: false,
position: 'left'
}
}
}
</script>
```
:::

## Drawer Props

| 参数 | 介绍 | 类型 | 可选值 | 默认值 |
|------|------|------|------|------|
| open `.sync` | 是否打开 | Boolean || false |
| right | 是否从右侧滑出 | Boolean || false |
| docked | 是否固定 drawer, 设为 `true`, 将不会显示遮盖层,也不会触发 `close` 事件 | Boolean || false |
| width | drawer 宽度 | String/Number |||
| z-depth | 阴影的深度 | Number | 0 — 5 | 2 |

<script>
export default {
data () {
return {
docked: false,
open: false,
position: 'left'
}
}
}
</script>

0 comments on commit c8d7dcb

Please sign in to comment.