日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Button按钮

發布時間:2023/12/8 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Button按钮 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

基礎用法

使用type、plain、round和circle屬性來定義Button的樣式。

<el-row><el-button>默認按鈕</el-button><el-button type="primary">主要按鈕</el-button><el-button type="success">成功按鈕</el-button><el-button type="info">信息按鈕</el-button><el-button type="warning">警告按鈕</el-button><el-button type="danger">危險按鈕</el-button> </el-row><el-row><el-button plain>樸素按鈕</el-button><el-button type="primary" plain>主要按鈕</el-button><el-button type="success" plain>成功按鈕</el-button><el-button type="info" plain>信息按鈕</el-button><el-button type="warning" plain>警告按鈕</el-button><el-button type="danger" plain>危險按鈕</el-button> </el-row><el-row><el-button round>圓角按鈕</el-button><el-button type="primary" round>主要按鈕</el-button><el-button type="success" round>成功按鈕</el-button><el-button type="info" round>信息按鈕</el-button><el-button type="warning" round>警告按鈕</el-button><el-button type="danger" round>危險按鈕</el-button> </el-row><el-row><el-button icon="el-icon-search" circle></el-button><el-button type="primary" icon="el-icon-edit" circle></el-button><el-button type="success" icon="el-icon-check" circle></el-button><el-button type="info" icon="el-icon-message" circle></el-button><el-button type="warning" icon="el-icon-star-off" circle></el-button><el-button type="danger" icon="el-icon-delete" circle></el-button> </el-row>

效果圖如下所示:

禁用狀態

使用disabled屬性來定義按鈕是否可用,它接收一個boolean值。

<el-row><el-button disabled>默認按鈕</el-button><el-button type="primary" disabled>主要按鈕</el-button><el-button type="success" disabled>成功按鈕</el-button><el-button type="info" disabled>信息按鈕</el-button><el-button type="warning" disabled>警告按鈕</el-button><el-button type="danger" disabled>危險按鈕</el-button> </el-row><el-row><el-button plain disabled>樸素按鈕</el-button><el-button type="primary" plain disabled>主要按鈕</el-button><el-button type="success" plain disabled>成功按鈕</el-button><el-button type="info" plain disabled>信息按鈕</el-button><el-button type="warning" plain disabled>警告按鈕</el-button><el-button type="danger" plain disabled>危險按鈕</el-button> </el-row>

效果圖如下所示:

文字按鈕

沒有邊框和背景色

<el-button type="text">文字按鈕</el-button> <el-button type="text" disabled>文字按鈕</el-button>

效果圖如下所示:

?

圖標按鈕

通過設置icon屬性即可,icon的列表可以參考Element的icon組件,也可以設置在文字右邊的icon,只要使用i標簽即可,可以使用自定義標簽。

<el-button type="primary" icon="el-icon-edit"></el-button> <el-button type="primary" icon="el-icon-share"></el-button> <el-button type="primary" icon="el-icon-delete"></el-button> <el-button type="primary" icon="el-icon-search">搜索</el-button> <el-button type="primary">上傳<i class="el-icon-upload el-icon--right"></i></el-button>

效果圖如下所示:

?

?

按鈕組

使用<el-button-group>標簽來嵌套你的按鈕。

<el-button-group><el-button type="primary" icon="el-icon-arrow-left">上一頁</el-button><el-button type="primary">下一頁<i class="el-icon-arrow-right el-icon--right"></i></el-button> </el-button-group> <el-button-group><el-button type="primary" icon="el-icon-edit"></el-button><el-button type="primary" icon="el-icon-share"></el-button><el-button type="primary" icon="el-icon-delete"></el-button> </el-button-group>

效果圖如下所示:

?

?

加載中

點擊按鈕后進行數據加載操作,在按鈕上顯示加載狀態。

要設置為loading狀態,只要設置loading屬性為true即可。

<el-button type="primary" :loading="true">加載中</el-button>

效果圖如下所示:

?

?

不同尺寸

額外尺寸:medium、small、mini,通過設置size屬性來配置他們。

<el-row><el-button>默認按鈕</el-button><el-button size="medium">中等按鈕</el-button><el-button size="small">小型按鈕</el-button><el-button size="mini">超小按鈕</el-button> </el-row> <el-row><el-button round>默認按鈕</el-button><el-button size="medium" round>中等按鈕</el-button><el-button size="small" round>小型按鈕</el-button><el-button size="mini" round>超小按鈕</el-button> </el-row>

效果圖如下所示:

?

?

?

Attributes

參數說明類型可選值默認值
size尺寸stringmedium/small/mini——
type類型stringprimary/success/warning/danger/info/text——
plain是否樸素按鈕boolean——false
round是否圓角按鈕boolean——false
circle是否圓形按鈕boolean——false
loading是否加載中狀態boolean——false
disable是否禁用狀態boolean——false
icon圖標類型string——

——

autofocus是否默認聚焦boolean——false
native-type原生type屬性stringbutton/submit/resetbuttom

?

總結

以上是生活随笔為你收集整理的Button按钮的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。