Ng-zorro-antd: nz-table 纵向支持滚动的问题

Created on 3 Jan 2018  ·  6Comments  ·  Source: NG-ZORRO/ng-zorro-antd

nzScroll目前只支持固定数值,不能自适应或设置百分比
是否应该支持自适应高度呢?

Invalid

Most helpful comment

All 6 comments

Hello @Charles953, your issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue, thank you!

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.

可以自适应的;
只不过需要自己手动设置容器变化监测机制,
nzScroll的绑定对象在ts文件中设置,每次容器宽高改变时,
都重新给nzScroll所绑定的对象重新赋值;

切记不能这样,这样是无效的:
假设:
public height:number;
//下面是nzScroll绑定的对象
public scroll={
y:this.heght+'px'
}

//这样子写,直接修改height是没有效果的
//而是直接修改scroll这个对象
//如:起初scroll赋值是
public scroll={
y:'300px'
}
//后面要滚动自适应就要直接修改scroll对象值
scroll.y='400px'
//这样就有效果了

通过修改css就可以直接获得自适应高度的table了
例子可见
https://stackblitz.com/edit/ng-zorro-antd-start-4w8y3b?file=src%2Fapp%2Fapp.component.css

vthinkxie是对的!我那个方式是错误的

Was this page helpful?
0 / 5 - 0 ratings