VisActor / VisActor/VTable

[Bug] 使用register.icon时,style中提示没有fill属性。定义style时,需要定义所有属性,否则有告警

Open
#4,239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
486
Avg merge
1d 19h
Merged PRs (30d)
16

Description

Version

1.19.3

Link to Minimal Reproduction

none

Steps to Reproduce

注册 text icon的时候会出现这个问题
VTable.register.icon('add', {
type: 'text',
content: '新增',
name: 'add',
positionType: VTable.TYPES.IconPosition.left,
marginLeft: 10,
cursor: 'pointer' ,
style: {
fill: '#0f7edf',
underline: 0,
fontSize: 13
}
});

报错对象字面量只能指定已知属性,并且“fill”不在类型“ITextAttribute”中。ts-plugin(2353)

Current Behavior

如果取消 fill 就会报错 类型“{ underline: number; fontSize: number; }”缺少类型“ITextAttribute”的以下属性: text, maxLineWidth, maxWidth, textAlign 及其他 20 项。ts-plugin(2740)

Expected Behavior

希望能提供 有效的临时解决方案,或者能修复

Environment
- OS:
- Browser:
- Framework:
Any additional comments?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the TypeScript declarations behind VTable.register.icon and the ITextAttribute type; reproduce the reported text-icon registration with the shown style. Done means the documented style is accepted without requiring unrelated attributes or producing the fill error, with a regression check if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.