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

使用iview 组件库 table 组件,其中resizable 失效,无法拖拽调整该列的宽度 #5

Closed
ChenXplorer opened this issue Nov 9, 2020 · 3 comments

Comments

@ChenXplorer
Copy link

image

代码使用如下: 无法拖拽调整该列的宽度

image

@ChenXplorer ChenXplorer changed the title 使用iviewUI 组件table 组件,其中resizable 失效,无法拖拽调整该列的宽度 使用iview 组件库 table 组件,其中resizable 失效,无法拖拽调整该列的宽度 Nov 9, 2020
@ChenXplorer
Copy link
Author

独自抽成一个组件,然后columns 放在组件里面可以,类似这样
image,但是提取出来放attributes 就会失效

@FrominXu
Copy link
Collaborator

FrominXu commented Nov 9, 2020

image

代码使用如下: 无法拖拽调整该列的宽度

image

因为i-table的列宽依赖width属性,在调整列宽时,会更新该属性。而在sifo上,columns属性是作为props传入的,props不允许直接更改。
如何解决:可以使用on-column-width-resize方法,在sifo插件中用addEventListener监听此方法,并在该方法触发时用setAttributes更新相应列的width属性。
类似下图的onColResize的用法
image

@ChenXplorer
Copy link
Author

xiexie

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