docs: some fixes

This commit is contained in:
07akioni 2021-12-10 03:41:32 +08:00
parent c9fb32d058
commit d1d52fdc4c
9 changed files with 26 additions and 18 deletions

View File

@ -1,4 +1,4 @@
# With Header
# With header
Use `header` slot to customize header.

View File

@ -1,4 +1,4 @@
# Manually Positioned
# Manually positioned
Click it.

View File

@ -1,4 +1,4 @@
# No Arrow
# No arrow
```html
<n-popover trigger="hover" :show-arrow="false">

View File

@ -1,4 +1,4 @@
# Raw Content
# Raw content
```html
<n-popover trigger="hover" raw :show-arrow="false">

View File

@ -1,12 +1,20 @@
# Body Style
# Body style
Set style attribute to style the popover.
```html
<n-popover :style="{ width: '500px' }" trigger="hover">
<template #trigger>
<n-button> Width 500px </n-button>
</template>
<span>Looks like a bar</span>
</n-popover>
<n-space>
<n-popover :style="{ width: '500px' }" trigger="hover">
<template #trigger>
<n-button>Width 500px</n-button>
</template>
Looks like a bar
</n-popover>
<n-popover :style="{ maxWidth: '100px' }" trigger="hover">
<template #trigger>
<n-button style="margin:0;">Max width 100px</n-button>
</template>
Who kicks a hole in the sky so the heaven cry over me.
</n-popover>
</n-space>
```

View File

@ -1,4 +1,4 @@
# Use Trigger Width
# Use trigger width
Set `width="trigger"` to make popover's width the same as its trigger.

View File

@ -6,15 +6,15 @@
<n-space>
<n-popover :style="{ width: '500px' }" trigger="hover">
<template #trigger>
<n-button style="margin:0;"> 宽度 500px </n-button>
<n-button style="margin:0;">宽度 500px</n-button>
</template>
<span>长得像根条一样</span>
长得像根条一样
</n-popover>
<n-popover :style="{ maxWidth: '100px' }" trigger="hover">
<template #trigger>
<n-button style="margin:0;"> 最大宽度 100px </n-button>
<n-button style="margin:0;">最大宽度 100px</n-button>
</template>
<span>内容长度不确定的时候,设置最大宽度可能更好看</span>
内容长度不确定的时候,设置最大宽度可能更好看
</n-popover>
</n-space>
```

View File

@ -48,7 +48,7 @@ download
| show-preview-button | `boolean` | `true` | Show a preview button (when `list-type` is `image-card`). Use the `on-preview` callback for this event. | |
| show-remove-button | `boolean` | `true` | Show a remove button (after upload completed). Use the `on-remove` callback for this event. | |
| show-retry-button | `boolean` | `true` | Show a retry button (for a failed upload). | |
| show-trigger | `boolean` | `true` | Show upload trigger. | NEXT_VERSION |
| show-trigger | `boolean` | `true` | Show upload trigger. | 2.21.5 |
| with-credentials | `boolean` | `false` | Any credentials to be sent with the request (e.g. cookie). | |
| on-change | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, event?: Event }) => void` | `() => {}` | Uploaded file(s) status change callback. | |
| on-update:file-list | `(fileList: UploadFileInfo[]) => void` | `undefined` | Callback function triggered on file-list changes. | |

View File

@ -49,7 +49,7 @@ retry-debug
| show-retry-button | `boolean` | `true` | 是否显示重新上传按钮(在 error 时展示) | |
| show-file-list | `boolean` | `true` | 是否显示文件列表 | |
| show-preview-button | `boolean` | `true` | 是否允许显示预览按钮(在 `list-type``image-card` 时生效) | |
| show-trigger | `boolean` | `true` | 是否显示触发元素 | NEXT_VERSION |
| show-trigger | `boolean` | `true` | 是否显示触发元素 | 2.21.5 |
| with-credentials | `boolean` | `false` | 是否携带 Cookie | |
| on-change | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, event?: Event }) => void` | `() => {}` | 组件状态变化的回调,组件的任何文件状态变化都会触发回调 | |
| on-finish | `(options: { file: UploadFileInfo, event: Event }) => UploadFileInfo \| void` | `({ file }) => file` | 文件上传结束的回调,可以修改传入的 UploadFileInfo 或者返回一个新的 UploadFileInfo。注意file 将会下一次事件循环中被置为 null | |