Skip to content

Commit 9152360

Browse files
author
sj
committed
refactor(tree-checked): 重构tree-checked组件样式 uiwjs#845
1 parent 7aadef7 commit 9152360

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/react-tree-checked/src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { Fragment } from 'react';
22
import Tree, { TreeProps, TreeRenderTitleNode, TreeData } from '@uiw/react-tree';
33
import Checkbox, { CheckboxProps } from '@uiw/react-checkbox';
4-
import './style/index.less';
4+
// import './style/index.less';
5+
import { TreeCheckbox } from './style/index';
56

67
export interface TreeCheckedProps extends TreeProps {}
78

@@ -24,7 +25,7 @@ export default function TreeChecked({ prefixCls = 'w-treechecked', ...props }: T
2425
}
2526
return (
2627
<Fragment>
27-
<Checkbox className={`${prefixCls}-checked`} disabled={node.disabled} {...checkedProps} />
28+
<TreeCheckbox as={Checkbox} className={`${prefixCls}-checked`} disabled={node.disabled} {...checkedProps} />
2829
{item.label && <span className={node.disabledClass}>{item.label}</span>}
2930
</Fragment>
3031
);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import styled from 'styled-components';
2+
3+
interface TreeCheckedProps {
4+
defaultTheme?: Record<string, string | number>;
5+
}
6+
7+
export const TreeCheckbox = styled.div<TreeCheckedProps>`
8+
margin-right: 5px;
9+
`;

0 commit comments

Comments
 (0)