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

Grid 布局是否可以增加栅格间偏移量,不是指space-x, space-x, space-y这种间距 #25

Closed
fanzouguo opened this issue Sep 20, 2018 · 4 comments

Comments

@fanzouguo
Copy link

类似于 offset-x ,就可以让 col 和前一个 col 间隔 x 个 栅格

@vvpvvp
Copy link
Member

vvpvvp commented Sep 22, 2018

其实heyui的栅格和其他的不太一样,能列举一下应用场景吗?
当时由于没有想到真实的应用场景,所以,就没有添加这种属性。

@fanzouguo
Copy link
Author

主要还是在布局场景,比如说需要以下的布局样式,
default
在目前的情况下,只能将中间的 Col宽度设为 14,然后再自己去处理这个 Col 内的元素,使其只占 14 cell 中的 4 cell,而我实际需要的只是 width=4,在这种情况下,可能会存在 与上一行对齐上的困扰,比如 4 / 14 不能整除,也无法通过固定的 px 等方式去处理。

@fanzouguo
Copy link
Author

补充说明一下,这个问题本来是在表单布局的时候遇到的。由于目前 form最多支持 3 列,遇到更多列的时候,只能改用 row 布局,但并非每行存在的列元素都一样多,需要控制位置时,就遇到了这个需求。

@vvpvvp
Copy link
Member

vvpvvp commented Oct 3, 2018

如果是这样的需求,我建议使用:

<Row>
<Col :width="6"></Col>
<Col :width="4"></Col>
<Col :width="10"></Col>
<Col :width="4"></Col>
</Row>

@vvpvvp vvpvvp closed this as completed Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants