diff --git a/components/tree/style/index.less b/components/tree/style/index.less index e12eb10f..12bcf065 100644 --- a/components/tree/style/index.less +++ b/components/tree/style/index.less @@ -78,6 +78,8 @@ flex-grow: 1; align-items: center; height: @data-input-height-base; + // 可阻止被子元素撑开宽度 + min-width: 0; &-prefix { display: inline-flex; margin-right: @padding-xs; diff --git a/components/tree/style/index.ts b/components/tree/style/index.ts index 7e2891f2..ed51d175 100644 --- a/components/tree/style/index.ts +++ b/components/tree/style/index.ts @@ -1,4 +1,2 @@ import '../../style'; -import '../../checkbox/style'; -import '../../virtual-list/style'; import './index.less'; diff --git a/components/tree/tree.tsx b/components/tree/tree.tsx index 976f0d0f..68007768 100644 --- a/components/tree/tree.tsx +++ b/components/tree/tree.tsx @@ -2,7 +2,7 @@ import { defineComponent, provide, VNodeChild } from 'vue'; import { isFunction, isString } from 'lodash-es'; import getPrefixCls from '../_util/getPrefixCls'; import { useTheme } from '../_theme/useTheme'; -import VirtualList from '../virtual-list/virtualList'; +import VirtualList from '../virtual-list'; import TreeNode from './treeNode'; import { COMPONENT_NAME } from './const'; import useData from './useData'; diff --git a/components/tree/treeNode.tsx b/components/tree/treeNode.tsx index 6c248282..a2a07b9d 100644 --- a/components/tree/treeNode.tsx +++ b/components/tree/treeNode.tsx @@ -10,7 +10,8 @@ import { isUndefined } from 'lodash-es'; import getPrefixCls from '../_util/getPrefixCls'; import CaretDownOutlined from '../icon/CaretDownOutlined'; import LoadingOutlined from '../icon/LoadingOutlined'; -import Checkbox from '../checkbox/checkbox.vue'; +import Checkbox from '../checkbox'; +import FEllipsis from '../ellipsis'; import { COMPONENT_NAME, INDENT } from './const'; import useTreeNode from './useTreeNode'; @@ -246,9 +247,10 @@ export default defineComponent({ onClick={handleClickContent} > {renderPrefix()} - - {props.label} - + {renderSuffix()}