Skip to content

Input.Search的enterButton参数能否有更好的兼容自定义组件 #2519

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

Closed
1 task done
ConquerStars opened this issue Jul 3, 2020 · 5 comments
Closed
1 task done
Labels

Comments

@ConquerStars
Copy link

ConquerStars commented Jul 3, 2020

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

What problem does this feature solve?

解决自定义组件(button的封装) 使用enterButton参数时,重复嵌套一层button导致样式问题

What does the proposed API look like?

我发现使用了ant-design自带的a-button不会出现嵌套button标签,而使用其他标签,包括自定义组件标签,会导致强行嵌套一层button标签,即使自定义标签名称为a-button。能否识别 在使用slot="enterButton"时的自定义组件是a-button封装(btn封装)的情况,减少嵌套重复button标签导致样式问题。

@xrkffgg
Copy link
Member

xrkffgg commented Jul 7, 2020

没明白啥意思,给个例子 看看。

@ConquerStars
Copy link
Author

没明白啥意思,给个例子 看看。

https://codesandbox.io/s/magical-shadow-1ftjx?file=/src/components/CaptchaBtn.vue

@xrkffgg
Copy link
Member

xrkffgg commented Jul 7, 2020

https://codesandbox.io/s/boring-http-123he?file=/src/App.vue

把你例子中 CaptchaBtn 挪到外层就正常了。。。可见是你的自定义组件写法的原因。

@ConquerStars
Copy link
Author

https://codesandbox.io/s/boring-http-123he?file=/src/App.vue

把你例子中 CaptchaBtn 挪到外层就正常了。。。可见是你的自定义组件写法的原因。

嗯,我是想复用我的 CaptchaBtn 组件,因为挺多页面要用到。按照你现在的写法的话,只能是在a-input-search外封装一层了

@xrkffgg xrkffgg closed this as completed Jul 8, 2020
@github-actions
Copy link

github-actions bot commented Jul 9, 2021

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 Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants