Skip to content

Commit 7e13455

Browse files
committed
docs: Improvement InputNumber
- Change min/max insertion position. - Change the crate that is added to T impl for conciseness. - Uniformity of expression: maximum for minimum.
1 parent f12ee15 commit 7e13455

File tree

1 file changed

+9
-9
lines changed
  • demo_markdown/docs/input_number

1 file changed

+9
-9
lines changed

demo_markdown/docs/input_number/mod.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ view! {
1212
}
1313
```
1414

15-
### Disabled
15+
### Min / Max
1616

1717
```rust demo
1818
let value = create_rw_signal(0);
1919

2020
view! {
21-
<InputNumber value step=1 disabled=true/>
21+
<InputNumber value step=1 min=-1 max=2/>
2222
}
2323
```
2424

25-
### Invalid
25+
### Disabled
2626

2727
```rust demo
2828
let value = create_rw_signal(0);
2929

3030
view! {
31-
<InputNumber value step=1 invalid=true/>
31+
<InputNumber value step=1 disabled=true/>
3232
}
3333
```
3434

35-
### Min / Max
35+
### Invalid
3636

3737
```rust demo
3838
let value = create_rw_signal(0);
3939

4040
view! {
41-
<InputNumber value step=1 min=-1 max=2/>
41+
<InputNumber value step=1 invalid=true/>
4242
}
4343
```
4444

@@ -50,15 +50,15 @@ view! {
5050
| value | `Model<T>` | `T::default()` | Set the input value. |
5151
| placeholder | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Placeholder of input number. |
5252
| step | `MaybeSignal<T>` | | The number which the current value is increased or decreased on key or button press. |
53+
| min | `MaybeSignal<T>` | `T::min_value()` | The minimum number that the input value can take. |
54+
| max | `MaybeSignal<T>` | `T::max_value()` | The maximum number that the input value can take. |
5355
| disabled | `MaybeSignal<bool>` | `false` | Whether the input is disabled. |
5456
| invalid | `MaybeSignal<bool>` | `false` | Whether the input is invalid. |
5557
| attr: | `Vec<(&'static str, Attribute)>` | `Default::default()` | The dom attrs of the input element inside the component. |
56-
| min | `MaybeSignal<T>` | `T::min_value()` | The minimum number that the input value can take. |
57-
| max | `MaybeSignal<T>` | `T::max_value()` | The max number that the input value can take. |
5858

5959
#### T impl
6060

61-
`T: Add<Output = T> + Sub<Output = T> + PartialOrd + num_traits::Bounded + Default + Clone + FromStr + ToString + 'static`
61+
`T: Add<Output = T> + Sub<Output = T> + PartialOrd + num::Bounded + Default + Clone + FromStr + ToString + 'static`
6262

6363
### InputNumber Ref
6464

0 commit comments

Comments
 (0)