-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(input-number): add update-value-on-input prop, closes #1664
- Loading branch information
Showing
7 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Timing to change | ||
|
||
Set `update-value-on-input` to `false`, the value won't be changed on input. | ||
|
||
```html | ||
<n-space vertical> | ||
<n-input-number | ||
:update-value-on-input="false" | ||
v-model:value="value" | ||
placeholder="" | ||
:min="20" | ||
:max="50" | ||
/> | ||
<n-input-number v-model:value="value" placeholder="" :min="20" :max="50" /> | ||
{{ value }} | ||
</n-space> | ||
``` | ||
|
||
```js | ||
import { defineComponent, ref } from 'vue' | ||
|
||
export default defineComponent({ | ||
setup () { | ||
return { | ||
value: ref(35) | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 改变值的时机 | ||
|
||
将 `update-value-on-input` 设为 `false`,则在输入的过程中不会改变值。 | ||
|
||
```html | ||
<n-space vertical> | ||
<n-input-number | ||
:update-value-on-input="false" | ||
v-model:value="value" | ||
placeholder="" | ||
:min="20" | ||
:max="50" | ||
/> | ||
<n-input-number v-model:value="value" placeholder="" :min="20" :max="50" /> | ||
{{ value }} | ||
</n-space> | ||
``` | ||
|
||
```js | ||
import { defineComponent, ref } from 'vue' | ||
|
||
export default defineComponent({ | ||
setup () { | ||
return { | ||
value: ref(35) | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters