001c2097a3
Created by Github action <!-- mintlify-editor-comments:start --> Mintlify --- 0 threads from 0 users in Mintlify - No unresolved comments <!-- mintlify-editor-comments:end --> <!-- mintlify-comment--> <a href="https://dashboard.mintlify.com/twenty/twenty/editor/i18n-docs?source=pr_comment" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-light.svg"><img src="https://d3gk2c5xim1je2.cloudfront.net/assets/open-mintlify-editor-light.svg" alt="Open in Mintlify Editor"></picture></a> <!-- /mintlify-comment --> Co-authored-by: github-actions <github-actions@twenty.com>
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
---
|
|
title: 图像输入
|
|
image: /images/user-guide/objects/objects.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/objects/objects.png" alt="标题" />
|
|
</Frame>
|
|
|
|
允许用户上传和删除图像。
|
|
|
|
<Tabs>
|
|
<Tab title="**用法**">
|
|
|
|
```jsx
|
|
import { ImageInput } from "@/ui/input/components/ImageInput";
|
|
|
|
export const MyComponent = () => {
|
|
return <ImageInput/>;
|
|
};
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="属性">
|
|
|
|
|
|
| 属性 | 类型 | 描述 |
|
|
| ------------ | --- | --------------------------------- |
|
|
| 图片 | 字符串 | 图片来源 URL |
|
|
| onUpload | 函数 | 当用户上传新的图片时调用的函数。 接收 `File` 对象作为参数 |
|
|
| onRemove | 函数 | 当用户点击移除按钮时调用的函数 |
|
|
| onAbort | 函数 | 当用户在上传图片过程中点击中止按钮时调用的函数 |
|
|
| isUploading | 布尔值 | 指示图像当前是否正在上传中 |
|
|
| errorMessage | 字符串 | 在图片输入下方显示的可选错误消息 |
|
|
| disabled | 布尔值 | 如果 `true` ,整个输入被禁用,按钮不可点击 |
|
|
|
|
|
|
|
|
|
|
</Tab>
|
|
</Tabs>
|