Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.x Add missing update:prop events #3898

Closed
1 task done
viruscamp opened this issue Apr 6, 2021 · 7 comments
Closed
1 task done

1.x Add missing update:prop events #3898

viruscamp opened this issue Apr 6, 2021 · 7 comments

Comments

@viruscamp
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

I will send pull requests later.

What problem does this feature solve?

For 1.x version, Add missing update:prop events for components, to use :prop.sync="p".
针对 1.x 版,补上各个组件 缺少的事件 update:prop 以便使用 :prop.sync="p" 语法。

TODO Component props events 待增加 to add
[] auto-complete open dropdownVisibleChange
[] select open dropdownVisibleChange
[] cascader popupVisible popupVisibleChange
[] card activeTabKey tabChange
[] date-picker open openChange
[] 未定 drawer visible afterVisibleChange
[] 未定 carousel afterChange
beforeChange
属性 activeSlideNumber
事件 update:activeSlideNumber
[] 未定 transfer selectedKeys
targetKeys
selectChange
change
v-model dropdown visible visibleChange
v-model popconfirm visible visibleChange
v-model tooltip visible visibleChange
已有 time-picker open openChange
update:open
已有 menu openKeys openChange
update:openKeys
已有 pagination pageSize  showSizeChange
update:pageSize

What does the proposed API look like?

@viruscamp
Copy link
Author

前5个,应该很容易加。
3个未定的,需要多考虑怎么做。
后面的都是已有的, 还有属性和事件已经是 v-model 的。

@viruscamp
Copy link
Author

viruscamp commented Apr 6, 2021

关于的文档编写。 考虑同一为 属性上写 visible(.sync) value(v-model) 。删除解释 .sync 用法与关联事件的说明。
如果只有一个 update:visible 和 v-model 关联的事件, 则不写在事件表中。
如果有为兼容考虑保留的同功能事件,事件表同一格中写出,同样不解释 .sync 用法与关联属性。 如:

Events Name Description Arguments Version
visibleChange
update:visible
Callback for when visible is changed Function(visible)

viruscamp added a commit to viruscamp/ant-design-vue that referenced this issue Apr 6, 2021
see vueComponent#3898 AAutoComplete.open ASelect.open ACascader.popupVisible ACard.activeTabKey ADatePicker.open
@tangjinzhou
Copy link
Member

这几个组件的 open visible 并不是很常用,很少场景需要控制 open visible

是否有必要支持这类改动

@viruscamp
Copy link
Author

我希望能保证一种统一性。
time-picker 已经加了,其他几个没有道理不加啊。
auto-complete select cascader date-picker 以及 time-picker 的 popupVisible open 和对应事件,很明显是同一个东西。
命名时最好就能保持一致。 但兼容性考虑让我不好改名字。
而对应的 update:prop 事件其实已经有了,仅仅是事件名字不同而已。

@viruscamp
Copy link
Author

类似的属性以及对应事件命名,2.x 最好能统一,趁现在改代价小。

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants