e0d4492013
Created by Github action Co-authored-by: github-actions <github-actions@twenty.com>
35 lines
1.3 KiB
Plaintext
35 lines
1.3 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>
|