mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
feat(auto-complete): add onUpdateValue prop (#999)
This commit is contained in:
parent
376a88988d
commit
a018945240
@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## Pending
|
||||
|
||||
### Feats
|
||||
|
||||
- `n-auto-complete` add `onUpdateValue` prop.
|
||||
|
||||
## 2.16.7 (2021-08-27)
|
||||
|
||||
### Feats
|
||||
|
@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## Pending
|
||||
|
||||
### Feats
|
||||
|
||||
- `n-auto-complete` 新增 `onUpdateValue` 方法
|
||||
|
||||
## 2.16.7 (2021-08-27)
|
||||
|
||||
### Feats
|
||||
|
@ -76,8 +76,8 @@ const autoCompleteProps = {
|
||||
default: () => []
|
||||
},
|
||||
zIndex: Number,
|
||||
// eslint-disable-next-line vue/prop-name-casing
|
||||
'onUpdate:value': [Function, Array] as PropType<MaybeArray<OnUpdateValue>>,
|
||||
onUpdateValue: [Function, Array] as PropType<MaybeArray<OnUpdateValue>>,
|
||||
onSelect: [Function, Array] as PropType<MaybeArray<OnSelect>>,
|
||||
onBlur: [Function, Array] as PropType<MaybeArray<(e: FocusEvent) => void>>,
|
||||
onFocus: [Function, Array] as PropType<MaybeArray<(e: FocusEvent) => void>>,
|
||||
@ -144,9 +144,10 @@ export default defineComponent({
|
||||
)
|
||||
)
|
||||
function doUpdateValue (value: string | null): void {
|
||||
const { 'onUpdate:value': onUpdateValue, onInput } = props
|
||||
const { 'onUpdate:value': _onUpdateValue, onUpdateValue, onInput } = props
|
||||
const { nTriggerFormInput, nTriggerFormChange } = formItem
|
||||
if (onUpdateValue) call(onUpdateValue as OnUpdateImpl, value)
|
||||
if (_onUpdateValue) call(_onUpdateValue as OnUpdateImpl, value)
|
||||
if (onInput) call(onInput as OnUpdateImpl, value)
|
||||
uncontrolledValueRef.value = value
|
||||
nTriggerFormInput()
|
||||
|
Loading…
Reference in New Issue
Block a user