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

SwipeAction组件能不能控制滑块的宽度 #1595

Closed
zhengshuai1001 opened this issue Jul 24, 2017 · 7 comments
Closed

SwipeAction组件能不能控制滑块的宽度 #1595

zhengshuai1001 opened this issue Jul 24, 2017 · 7 comments
Assignees
Labels

Comments

@zhengshuai1001
Copy link

What problem does this feature solve?

默认滑动出来的div是正方形,怎么让滑块根据文字多少自动变宽,自己改变CSS之后,滑块的总长度还是没变

What does the proposed API look like?

希望可以自定义每个滑块的宽度

@ant-design-bot
Copy link

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.
See: ant-design/ant-design#4897

@zhengshuai1001
Copy link
Author

JS是怎么控制滑块滑动的距离的?即滑块滑动时的CSS的 left 值可以修改吗?

@warmhug
Copy link
Contributor

warmhug commented Jul 24, 2017

看代码应该是没法根据内容来自适应宽度的,是有点不灵活。

@zhengshuai1001
Copy link
Author

请问能用js控制滑块移动的距离吗?
tim 20170725100023
这个图是滑动后的效果,有四个滑块,本来每个滑块是正方形,我用CSS将宽度改窄了。但是右边多出来一截空白?

@silentcloud
Copy link
Contributor

silentcloud commented Jul 25, 2017

很多计算都是根据 这个 width 来做的,如果 width 可以自定义,在计算的时候就会很复杂,而且用户有可能每个 button 还不一样宽的话,就没办法做了;

有兴趣研究的,来 PR https://github.com/react-component/swipeout/blob/master/src/Swipeout.tsx

@warmhug warmhug changed the title SwipeActio组件能不能控制滑块的宽度 SwipeAction组件能不能控制滑块的宽度 Jul 25, 2017
@silentcloud
Copy link
Contributor

@silentcloud
Copy link
Contributor

silentcloud commented Aug 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants