VisActor / VisActor/VTable

[Feature] Menu 组件不能自定义样式

Open
#2,786 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What problem does this feature solve?

import { ListTable, Menu, Tooltip } from '@visactor/react-vtable';

export type MenuProps = {
/** 代替原来的option.menuType html目前实现较完整 先默认html渲染方式*/
renderMode?: 'canvas' | 'html';
/** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/
defaultHeaderMenuItems?: TYPES.MenuListItem[];
/** 右键菜单。代替原来的option.contextmenu /
contextMenuItems?:
| TYPES.MenuListItem[]
| ((field: string, row: number, col: number, table?: BaseTable) => TYPES.MenuListItem[]);
/
* 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
} & BaseComponentProps;

type MenuListItem =
| string
| {
text?: string;
type?: 'title' | 'item' | 'split';
menuKey?: string;
icon?: Icon;
selectedIcon?: Icon;
stateIcon?: Icon;
children?: MenuListItem[];
};

Menu 没有提供自定义样式的属性,希望提供可以修改 style和 className 样式的属性。

What does the proposed API look like?

希望提供可以修改 style和 className 样式的属性。

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 Menu component and its MenuProps definition in the react-vtable package, then trace how the menu is rendered and how BaseComponentProps is applied. The work is done when consumers can provide style and className properties and those values customize the rendered menu without changing the existing menu options.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.