我有一个使用内部样式表进行渲染的组件,我想用带样式的组件覆盖该类,因为我想根据样式组件的主题为其提供自定义颜色值。
我有以下内容:
const TSRoot = styled.span`
.rc-tree-select-tree-node-selected {
border: 10px black solid !important;
}
`
<TSRoot>
<TS
style={{ width: 300 }}
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
dropdownStyle={{ maxHeight: 200, overflow: 'auto' }}
placeholder={<i>请下拉选择</i>}
searchPlaceholder="please search"
multiple
treeNodeLabelProp="label"
treeNodeFilterProp="label"
allowClear
className="rc-tree-select"
treeData={[
{
title: <Label><b>Hello</b></Label>,
selectable: true,
label: <Label>Hello</Label>,
checkable: true,
key: 'hello',
value: 'hello',
children: [
{
title: "There",
value: "there",
checkable: true,
label: <Label>There</Label>,
}
]
}
]}
/>
</TSRoot>
不幸的是,以上操作无效。