Dynamic line height

未关闭
#59 0 条评论 9 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
react, typescript
领域
frontend

调研方向

从 List 组件的 itemHeight API 以及提供的 TSX 示例开始,该示例使用交替的 50 和 25 像素行。确定是否支持可变的项目高度,以及滚动和渲染需要什么行为;当所请求的动态高度情况得到支持,或其限制已被清楚地记录并验证时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Is it possible to have a dynamic line height or am I overlooking the feature?

What I would like to have:

const dynLineHeight = (row: any, index: number) => {
	if(index % 2 === 0){
		return 50;
	} else {
		return 25;
	}
}

<List data={[0, 1, 2]} height={200} itemHeight={this.dynLineHeight} itemKey="id">
  {index => <div>{index}</div>}
</List>;
主要语言
TypeScript
星标
815
派生
175
平均合并
1 天 13 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react-component/virtual-list 的其他 Issue

查看 react-component/virtual-list 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。