mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
docs: add example for autoInsertSpaceInButton (#45608)
* 增加autoInsertSpaceInButton属性的样例代码,防止加错位置 * 格式修改 * Update components/button/index.zh-CN.md Signed-off-by: lijianan <574980606@qq.com> * Update components/button/index.en-US.md Signed-off-by: lijianan <574980606@qq.com> * Update components/button/index.zh-CN.md Signed-off-by: lijianan <574980606@qq.com> * Update components/button/index.en-US.md Signed-off-by: lijianan <574980606@qq.com> * Update index.en-US.md Signed-off-by: lijianan <574980606@qq.com> * Update index.zh-CN.md Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
parent
c1891d8d3b
commit
46246268ac
@ -91,6 +91,12 @@ It accepts all props which native buttons support.
|
||||
|
||||
Following the Ant Design specification, we will add one space between if Button (exclude Text button and Link button) contains two Chinese characters only. If you don't need that, you can use [ConfigProvider](/components/config-provider/#api) to set `autoInsertSpaceInButton` as `false`.
|
||||
|
||||
```tsx
|
||||
<ConfigProvider autoInsertSpaceInButton={false}>
|
||||
<Button>按钮</Button>
|
||||
</ConfigProvider>
|
||||
```
|
||||
|
||||
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" width="100px" height="64px" style="box-shadow: none; margin: 0;" alt="Button with two Chinese characters" />
|
||||
|
||||
<style>
|
||||
|
@ -96,6 +96,12 @@ group:
|
||||
|
||||
根据 Ant Design 设计规范要求,我们会在按钮内(文本按钮和链接按钮除外)只有两个汉字时自动添加空格,如果你不需要这个特性,可以设置 [ConfigProvider](/components/config-provider-cn#api) 的 `autoInsertSpaceInButton` 为 `false`。
|
||||
|
||||
```tsx
|
||||
<ConfigProvider autoInsertSpaceInButton={false}>
|
||||
<Button>按钮</Button>
|
||||
</ConfigProvider>
|
||||
```
|
||||
|
||||
<img src="https://gw.alipayobjects.com/zos/antfincdn/MY%26THAPZrW/38f06cb9-293a-4b42-b183-9f443e79ffea.png" style="box-shadow: none; margin: 0" width="100px" height="64px" alt="移除两个汉字之间的空格" />
|
||||
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user