You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -96,6 +108,49 @@ function handleChange({ value }) {
96
108
}
97
109
```
98
110
111
+
## Non-Immediate Update Mode
112
+
113
+
Set `immediate-change` to `false`, the `change` event will not be triggered immediately when the input box content changes, only when it loses focus or buttons are clicked.
Set the `update-on-init` property to control whether to update the `v-model` with the corrected value during initialization.
134
+
135
+
- When `update-on-init="true"` (default), the initial value will be corrected to comply with `min`, `max`, `step`, `precision` and other rules, and the `v-model` will be updated synchronously
136
+
- When `update-on-init="false"`, the initial value will not be corrected (v-model unchanged), but display formatting (such as precision) will still be applied
const value1 =ref<number>(1) // Will be auto-corrected to 4 (minimum multiple of 2 that is ≥3)
148
+
const value2 =ref<number>(1) // Remains 1, will not be corrected but will be formatted for display
149
+
function handleChange({ value }) {
150
+
console.log(value)
151
+
}
152
+
```
153
+
99
154
## Asynchronous Change
100
155
101
156
Through `before-change`, you can validate and intercept before the input value changes.
@@ -152,6 +207,9 @@ Set the `long-press` property to allow long press for increment/decrement.
152
207
| adjustPosition | Native property, whether to automatically push up the page when keyboard pops up | boolean | - | true | 1.3.11 |
153
208
| before-change | Triggered before input box value changes, returning false will prevent input box value from changing, supports returning `Promise`|`(value: number \| string) => boolean \| Promise<boolean>`| - | - | 1.6.0 |
154
209
| long-press | Whether to allow long press for increment/decrement | boolean | - | false | 1.8.0 |
210
+
| immediate-change | Whether to respond to input changes immediately, false will only update on blur and button clicks | boolean | - | true | $LOWEST_VERSION$ |
211
+
| update-on-init | Whether to update v-model with corrected value during initialization | boolean | - | true | $LOWEST_VERSION$ |
212
+
| input-type | Input field type | string | number / digit | digit | $LOWEST_VERSION$ |
0 commit comments