Skip to content

Commit fd711d5

Browse files
authored
fix(components): [tree] revert inherits the label class (element-plus#10812)
* revert slot inherit style * Adjust the size style attribute to tree
1 parent 6703747 commit fd711d5

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

packages/components/tree/src/tree-node-content.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ export default defineComponent({
2424
const { data, store } = node
2525
return props.renderContent
2626
? props.renderContent(h, { _self: nodeInstance, node, data, store })
27-
: h('span', { class: ns.be('node', 'label') }, [
28-
tree.ctx.slots.default
29-
? tree.ctx.slots.default({ node, data })
30-
: node.label,
31-
])
27+
: tree.ctx.slots.default
28+
? tree.ctx.slots.default({ node, data })
29+
: h('span', { class: ns.be('node', 'label') }, [node.label])
3230
}
3331
},
3432
})

packages/theme-chalk/src/tree.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
cursor: default;
1313
background: getCssVar('fill-color', 'blank');
1414
color: getCssVar('tree-text-color');
15+
font-size: getCssVar('font-size', 'base');
1516

1617
@include e(empty-block) {
1718
position: relative;
@@ -107,10 +108,6 @@
107108
}
108109
}
109110

110-
@include e(label) {
111-
font-size: getCssVar('font-size', 'base');
112-
}
113-
114111
@include e(loading-icon) {
115112
margin-right: 8px;
116113
font-size: getCssVar('font-size', 'base');

0 commit comments

Comments
 (0)