引用 :import { Button } from 'antd';
1 <Button
type = "primary" //按鈕樣式顏色
shape = "circle" //按鈕圓角(默認為方形)
icon = "search" //加圖標 ,string (search : 搜索 ,download : 下載 ),也可以直接插入Icon 標簽
size = "large" //按鈕大小,string 默認 middle
loading //加載狀態 ,布爾值 ,默認false
block //將寬度設為父元素的寬度 ,布爾值 ,默認false
disabled //按鈕失效,布爾值(默認false)
ghost //按鈕背景透明,一般用在父元素有背景色,按鈕為白色情況下 ,布爾值 (默認值false)
href = "baidu.com" //設置此屬性將按鈕轉換為a標簽 ,string
htmlType = "button" //按鈕原生type屬性 ,string
target = "_blank" //需要設置href屬性,具有超鏈接target屬性
onClick ={this.onclick} //點擊事件,需要注意this指向
>
按鈕講解
</Button>
1. 可以直接插入Icon標簽
<Button>按鈕<Icon type="team"/></Button>
2. type 值包括 : primary(藍色) ,dashed(虛線),danger(紅色),不寫type情況下為白色背景,黑字,邊框