naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

n-select组件添加失焦后更新值属性

Open Mobaiyufengfei opened this issue 1 year ago • 4 comments
trafficstars

Clear and concise description of the problem

n-select可以添加一个属性让用户选择是在失焦后更新绑定值还是实时更新绑定值

Suggested solution

与n-input-number的update-value-on-input一样,为false代表失焦后更新绑定值,为true代表实时更新绑定值

Alternative

No response

Additional context

No response

Validations

  • [X] Read the Contributing Guidelines.
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Mobaiyufengfei avatar Apr 02 '24 06:04 Mobaiyufengfei

@Mobaiyufengfei 这种是不是只适用于多选的情况下

jahnli avatar Apr 11 '24 01:04 jahnli

image

期望的是多选时点击选中,但图中马赛克区域的输入框不更新, 等失焦时更新 ?

jahnli avatar Apr 11 '24 01:04 jahnli

@Mobaiyufengfei 这种是不是只适用于多选的情况下

不是多选,就是我可以切换好几次我选中的select选项,这个过程中input框中显示的值是会随着更新的,但是不会触发绑定值的更新,等到我点组件外面的区域,让组件失去焦点后再更新绑定的值

Mobaiyufengfei avatar Apr 15 '24 05:04 Mobaiyufengfei

@Mobaiyufengfei 这种是不是只适用于多选的情况下

不是多选,就是我可以切换好几次我选中的select选项,这个过程中input框中显示的值是会随着更新的,但是不会触发绑定值的更新,等到我点组件外面的区域,让组件失去焦点后再更新绑定的值

你这需求跟vue的双向绑定不搭,不过我觉得你可以使用自定义渲染option实现

surge-squirrel avatar Apr 23 '24 06:04 surge-squirrel

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem

jahnli avatar Sep 24 '24 01:09 jahnli