From fb98d608ae638ab7591cb5cfa462e7c178848cfe Mon Sep 17 00:00:00 2001 From: luoxiao Date: Thu, 22 Aug 2024 16:52:24 +0800 Subject: [PATCH] feat: Upload adds id and name prop --- thaw/src/upload/docs/mod.md | 16 +++++++++------- thaw/src/upload/mod.rs | 7 +++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/thaw/src/upload/docs/mod.md b/thaw/src/upload/docs/mod.md index 1df4f59..334bd2a 100644 --- a/thaw/src/upload/docs/mod.md +++ b/thaw/src/upload/docs/mod.md @@ -46,13 +46,15 @@ view! { ### Upload Props -| Name | Type | Default | Description | -| -------------- | ---------------------------------- | -------------------- | ------------------------------------ | -| class | `MaybeProp` | `Default::default()` | | -| accept | `MaybeSignal` | `Default::default()` | The accept type of upload. | -| multiple | `MaybeSignal` | `false` | Allow multiple files to be selected. | -| custom_request | `Option>` | `None` | Customize upload request. | -| children | `Children` | | | +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| class | `MaybeProp` | `Default::default()` | | +| id | `MaybeProp` | `Default::default()` | | +| name | `MaybeProp` | `Default::default()` | A string specifying a name for the input control. This name is submitted along with the control's value when the form data is submitted. | +| accept | `MaybeSignal` | `Default::default()` | The accept type of upload. | +| multiple | `MaybeSignal` | `false` | Allow multiple files to be selected. | +| custom_request | `Option>` | `None` | Customize upload request. | +| children | `Children` | | | ### UploadDragger Props diff --git a/thaw/src/upload/mod.rs b/thaw/src/upload/mod.rs index d003e20..442f5d7 100644 --- a/thaw/src/upload/mod.rs +++ b/thaw/src/upload/mod.rs @@ -9,6 +9,11 @@ use thaw_utils::{add_event_listener, class_list, mount_style, ArcOneCallback}; #[component] pub fn Upload( #[prop(optional, into)] class: MaybeProp, + #[prop(optional, into)] id: MaybeProp, + /// A string specifying a name for the input control. + /// This name is submitted along with the control's value when the form data is submitted. + #[prop(optional, into)] + name: MaybeProp, /// The accept type of upload. #[prop(optional, into)] accept: MaybeSignal, @@ -87,6 +92,8 @@ pub fn Upload( ]>