官方默认Dropdown.Button是这样:
期望如下效果:
正常情况下,按钮的属性:
<Button type="primary" ghost>
Primary
</Button>
但是根据api文档显示,Dropdown.Button只支持type,不支持ghost,但是提供了一个buttonRander的函数。
所以可以根据这个函数进行实现。
<Dropdown.Button
...
buttonsRender={([leftButton, rightButton]) => [
React.cloneElement(leftButton, {ghost: true, type: 'primary'}),
React.cloneElement(rightButton, {ghost: true, type: 'primary'}),
]}
>
Language
</Dropdown.Button>