mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
feat: Upload adds id and name prop
This commit is contained in:
parent
9fbf507a36
commit
fb98d608ae
2 changed files with 16 additions and 7 deletions
|
@ -46,13 +46,15 @@ view! {
|
||||||
|
|
||||||
### Upload Props
|
### Upload Props
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| -------------- | ---------------------------------- | -------------------- | ------------------------------------ |
|
| --- | --- | --- | --- |
|
||||||
| class | `MaybeProp<String>` | `Default::default()` | |
|
| class | `MaybeProp<String>` | `Default::default()` | |
|
||||||
| accept | `MaybeSignal<String>` | `Default::default()` | The accept type of upload. |
|
| id | `MaybeProp<String>` | `Default::default()` | |
|
||||||
| multiple | `MaybeSignal<bool>` | `false` | Allow multiple files to be selected. |
|
| name | `MaybeProp<String>` | `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. |
|
||||||
| custom_request | `Option<ArcOneCallback<FileList>>` | `None` | Customize upload request. |
|
| accept | `MaybeSignal<String>` | `Default::default()` | The accept type of upload. |
|
||||||
| children | `Children` | | |
|
| multiple | `MaybeSignal<bool>` | `false` | Allow multiple files to be selected. |
|
||||||
|
| custom_request | `Option<ArcOneCallback<FileList>>` | `None` | Customize upload request. |
|
||||||
|
| children | `Children` | | |
|
||||||
|
|
||||||
### UploadDragger Props
|
### UploadDragger Props
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,11 @@ use thaw_utils::{add_event_listener, class_list, mount_style, ArcOneCallback};
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Upload(
|
pub fn Upload(
|
||||||
#[prop(optional, into)] class: MaybeProp<String>,
|
#[prop(optional, into)] class: MaybeProp<String>,
|
||||||
|
#[prop(optional, into)] id: MaybeProp<String>,
|
||||||
|
/// 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<String>,
|
||||||
/// The accept type of upload.
|
/// The accept type of upload.
|
||||||
#[prop(optional, into)]
|
#[prop(optional, into)]
|
||||||
accept: MaybeSignal<String>,
|
accept: MaybeSignal<String>,
|
||||||
|
@ -87,6 +92,8 @@ pub fn Upload(
|
||||||
]>
|
]>
|
||||||
<input
|
<input
|
||||||
class="thaw-upload__input"
|
class="thaw-upload__input"
|
||||||
|
id=move || id.get()
|
||||||
|
name=move || name.get()
|
||||||
node_ref=input_ref
|
node_ref=input_ref
|
||||||
type="file"
|
type="file"
|
||||||
accept=move || accept.get()
|
accept=move || accept.get()
|
||||||
|
|
Loading…
Add table
Reference in a new issue