naive-ui/demo/documentation/components/dropdown/zhCN/size.md

111 lines
1.7 KiB
Markdown
Raw Normal View History

2019-12-14 02:05:31 +08:00
# 尺寸
```html
<n-dropdown
placement="bottom-start"
trigger="click"
size="small"
@select="handleSelect"
2020-02-04 22:07:55 +08:00
:options="options"
2019-12-14 02:05:31 +08:00
:focusable="false"
>
2020-02-04 22:07:55 +08:00
<n-button>小号</n-button>
2019-12-14 02:05:31 +08:00
</n-dropdown>
<n-dropdown
placement="bottom-start"
trigger="click"
size="medium"
@select="handleSelect"
:focusable="false"
2020-02-04 22:07:55 +08:00
:options="options"
2019-12-14 02:05:31 +08:00
>
2020-02-04 22:07:55 +08:00
<n-button>中号</n-button>
2019-12-14 02:05:31 +08:00
</n-dropdown>
<n-dropdown
placement="bottom-start"
trigger="click"
size="large"
:focusable="false"
@select="handleSelect"
2020-02-04 22:07:55 +08:00
:options="options"
2019-12-14 02:05:31 +08:00
>
2020-02-04 22:07:55 +08:00
<n-button>大号</n-button>
</n-dropdown>
<n-dropdown
placement="bottom-start"
trigger="click"
size="large"
:focusable="false"
@select="handleSelect"
:options="options"
>
<n-button>巨大号</n-button>
2019-12-14 02:05:31 +08:00
</n-dropdown>
```
```js
2020-02-04 22:07:55 +08:00
const options = [
{
label: '杰·盖茨比',
key: 'jay gatsby'
},
{
label: '黛西·布坎南',
key: 'daisy buchanan'
},
{
type: 'divider'
},
{
label: '尼克·卡拉威',
key: 'nick carraway'
},
{
type: 'submenu',
label: '其他',
key: 'others',
children: [
{
label: '乔丹·贝克',
key: 'jordan baker'
},
{
label: '汤姆·布坎南',
key: 'tom buchanan'
},
{
type: 'submenu',
label: '其他',
key: 'others',
children: [
{
label: '鸡肉',
key: 'chicken'
},
{
label: '牛肉',
key: 'beef'
}
]
}
]
}
]
2019-12-14 02:05:31 +08:00
export default {
2020-02-04 22:07:55 +08:00
data () {
return {
options
}
},
2019-12-14 02:05:31 +08:00
methods: {
handleSelect (name) {
this.$NMessage.info(name)
}
}
}
```
```css
.n-button {
margin: 0 8px 12px 0;
}
```