mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
docs(NAvatar, NButton): Avatar and button page improvements (#885)
* Avatar page * Button page
This commit is contained in:
parent
4ea0a5850c
commit
ec8ccdee73
@ -1,6 +1,6 @@
|
||||
# Color
|
||||
|
||||
You can set it to something related to things you want to eat.
|
||||
You can set colors related to things you want to eat.
|
||||
|
||||
```html
|
||||
<n-avatar
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Icon
|
||||
|
||||
I like using icon in avatar.
|
||||
I like using an icon in an avatar.
|
||||
|
||||
```html
|
||||
<n-avatar>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Content Size
|
||||
|
||||
Words' sizing would be auto adjusted in avatar.
|
||||
Words are auto adjusted in avatar.
|
||||
|
||||
```html
|
||||
<n-space vertical item-style="line-height: 0;">
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Size
|
||||
|
||||
Avatar has `small`, `medium` and `large` size. You could alse custom size by a px number.
|
||||
Avatar has `small`, `medium` and `large` size. You could also use a custom size of px number.
|
||||
|
||||
```html
|
||||
<n-space align="flex-end">
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Basic
|
||||
|
||||
There are `default`, `primary`, `info`, `success`, `warning` and `error` type of button.
|
||||
There are `default`, `primary`, `info`, `success`, `warning` and `error` types of button.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Custom Color
|
||||
|
||||
The two colors look like toadstool.
|
||||
These two colors look like a toadstool.
|
||||
|
||||
```html
|
||||
<n-space align="center">
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Dashed
|
||||
|
||||
Use `dashed` to show dashed button.
|
||||
Use `dashed` to show a dashed button.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Disabled
|
||||
|
||||
Button can be disabled.
|
||||
Buttons can be disabled.
|
||||
|
||||
```html
|
||||
<n-button disabled> Disabled </n-button>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Events
|
||||
|
||||
Handle events on button.
|
||||
Handle events of buttons.
|
||||
|
||||
```html
|
||||
<n-button @click="handleClick">Click Me</n-button>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Ghost
|
||||
|
||||
Ghost button has transparent background.
|
||||
Ghost buttons have transparent backgrounds.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Button Group
|
||||
|
||||
Button can be grouped.
|
||||
Buttons can be grouped.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Use Icon as Button
|
||||
# Use Icons as Buttons
|
||||
|
||||
Sometimes you may want to use icon as button and customize its size. You can use `text` prop and `font-size` style to set it.
|
||||
Sometimes you may want to use an icon as a button and customize its size. You can use the `text` prop and `font-size` style to set it.
|
||||
|
||||
```html
|
||||
<n-button text style="font-size: 24px;">
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Icon
|
||||
|
||||
Use icon in button.
|
||||
Icons can be used in buttons.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Loading
|
||||
|
||||
Button has loading status.
|
||||
Buttons can have loading states.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Shape
|
||||
|
||||
Button has different shapes.
|
||||
Buttons can have different shapes.
|
||||
|
||||
```html
|
||||
<n-space>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Size
|
||||
|
||||
Button can be `tiny`, `small`, `medium` and `large` size.
|
||||
Buttons can be `tiny`, `small`, `medium` and `large` in size.
|
||||
|
||||
```html
|
||||
<n-space align="baseline">
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Tag
|
||||
|
||||
You can render button as different tags. For example `<a />`.
|
||||
You can render buttons with different tags. For example `<a />`.
|
||||
|
||||
```html
|
||||
<n-button
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Text Button
|
||||
|
||||
Just look like text.
|
||||
It just looks like text.
|
||||
|
||||
```html
|
||||
<n-button text>
|
||||
@ -9,7 +9,7 @@ Just look like text.
|
||||
<train-icon />
|
||||
</n-icon>
|
||||
</template>
|
||||
The Engine is Still Spiting Smoke
|
||||
The Engine is Still Spitting Smoke
|
||||
</n-button>
|
||||
```
|
||||
|
||||
|
@ -90,7 +90,7 @@ placement
|
||||
| --- | --- | --- |
|
||||
| closable | `boolean` | Whether to show close icon. |
|
||||
| content | `string \| (() => VNodeChild)` | Message content. |
|
||||
| destory | `() => void` | Message destory method. |
|
||||
| destroy | `() => void` | Message destroy method. |
|
||||
| icon | `() => VNode` | Message icon. |
|
||||
| type | `'info' \| 'success' \| 'warning' \| 'error' \| 'loading'` | Message type. |
|
||||
| onAfterLeave | `() => void` | Callback after message disappeared. |
|
||||
@ -100,7 +100,7 @@ placement
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | ---- | ----------------------- |
|
||||
| destroy | `()` | Message destory method. |
|
||||
| destroy | `()` | Message destroy method. |
|
||||
|
||||
## Q & A
|
||||
|
||||
|
@ -90,7 +90,7 @@ placement
|
||||
| --- | --- | --- |
|
||||
| closable | `boolean` | 是否显示 close 图标 |
|
||||
| content | `string \| (() => VNodeChild)` | 信息内容 |
|
||||
| destory | `() => void` | 销毁信息的方法 |
|
||||
| destroy | `() => void` | 销毁信息的方法 |
|
||||
| icon | `() => VNode` | 信息图标 |
|
||||
| type | `'info' \| 'success' \| 'warning' \| 'error' \| 'loading'` | 信息类型 |
|
||||
| onAfterLeave | `() => void` | 信息消失动画结束的回调 |
|
||||
|
Loading…
Reference in New Issue
Block a user