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

[Feat] 单元格表头区域设置渐变色 #1788

Open
Yang-yibu opened this issue May 24, 2024 · 4 comments
Open

[Feat] 单元格表头区域设置渐变色 #1788

Yang-yibu opened this issue May 24, 2024 · 4 comments
Assignees
Labels
feature 新需求

Comments

@Yang-yibu
Copy link

Yang-yibu commented May 24, 2024

Version

1.0.1

Link to Minimal Reproduction

https://visactor.io/vtable/demo/theme/extend

Steps to Reproduce

CSS background: linear-gradient(180deg,#d2e6ff,#f5faff)

将示例中的 theme.headerStyle.bgColor 换成

headerStyle: {
            bgColor: (args) => {
              // return '#d2e6ff';

              const _canvas = args.table.canvas;
              const ctx = _canvas.getContext('2d');

              // const gradient = ctx!.createLinearGradient(0, 0, _canvas.width, _canvas.height);
              const gradient = ctx!.createLinearGradient(0, 0, 0, 40);
              gradient.addColorStop(0, '#d2e6ff');
              gradient.addColorStop(1, '#f5faff');
              return gradient;
            }
}

Current Behavior

显示成了黄色背景
image

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@Yang-yibu Yang-yibu added the bug Something isn't working label May 24, 2024
@fangsmile
Copy link
Contributor

目前我们单元格的背景色bgColor不支持渐变配置形式。这个需求我们后面可以考虑下。
目前的话 你可以用自定义渲染来实现:参考 https://visactor.io/vtable/demo/business/sales-bubble
image

@Yang-yibu
Copy link
Author

Yang-yibu commented May 27, 2024

那 TS 类型提示用改下么?我以为我用法有问题

@fangsmile
Copy link
Contributor

好的 我们优化下吧。

@fangsmile fangsmile self-assigned this May 27, 2024
@fangsmile fangsmile added feature 新需求 and removed bug Something isn't working labels May 28, 2024
@fangsmile fangsmile changed the title [Bug] 单元格表头区域设置渐变色无效 [Feat] 单元格表头区域设置渐变色 May 28, 2024
@fangsmile
Copy link
Contributor

转为需求后续开发。可以在theme中表头 body 或者table整体 设置渐变色配置。
单元格的渐变也考虑下如何实现

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

No branches or pull requests

2 participants