Element Card 卡片的具體使用
組件— 卡片
基礎(chǔ)用法

<el-card class="box-card">
<div slot="header" class="clearfix">
<span>卡片名稱</span>
<el-button style="float: right; padding: 3px 0" type="text">操作按鈕</el-button>
</div>
<div v-for="o in 4" :key="o" class="text item">
{{'列表內(nèi)容 ' + o }}
</div>
</el-card>
<style>
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 480px;
}
</style>
簡(jiǎn)單卡片

<el-card class="box-card">
<div v-for="o in 4" :key="o" class="text item">
{{'列表內(nèi)容 ' + o }}
</div>
</el-card>
<style>
.text {
font-size: 14px;
}
.item {
padding: 18px 0;
}
.box-card {
width: 480px;
}
</style>
帶圖片

<el-row>
<el-col :span="8" v-for="(o, index) in 2" :key="o" :offset="index > 0 ? 2 : 0">
<el-card :body-style="{ padding: '0px' }">

<div style="padding: 14px;">
<span>好吃的漢堡</span>
<div class="bottom clearfix">
<time class="time">{{ currentDate }}</time>
<el-button type="text" class="button">操作按鈕</el-button>
</div>
</div>
</el-card>
</el-col>
</el-row>
<style>
.time {
font-size: 13px;
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.image {
width: 100%;
display: block;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
</style>
<script>
export default {
data() {
return {
currentDate: new Date()
};
}
}
</script>
卡片陰影

<el-row :gutter="12"> <el-col :span="8"> <el-card shadow="always"> 總是顯示 </el-card> </el-col> <el-col :span="8"> <el-card shadow="hover"> 鼠標(biāo)懸浮時(shí)顯示 </el-card> </el-col> <el-col :span="8"> <el-card shadow="never"> 從不顯示 </el-card> </el-col> </el-row>
Attributes:
| 參數(shù) | 類型 | 說(shuō)明 | 可選值 | 默認(rèn)值 |
|---|---|---|---|---|
| header | 設(shè)置 header,也可以通過(guò) slot#header 傳入 DOM | string | — | — |
| body-style | 設(shè)置 body 的樣式 | object | — | { padding: ‘20px' } |
到此這篇關(guān)于Element Card 卡片的具體使用的文章就介紹到這了,更多相關(guān)Element Card 卡片內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
vue實(shí)現(xiàn)隨機(jī)驗(yàn)證碼功能(完整代碼)
驗(yàn)證碼功能在我們的身邊用處極廣,今天小編給大家分享基于vue實(shí)現(xiàn)隨機(jī)驗(yàn)證碼功能,感興趣的朋友跟隨小編一起看看吧2019-12-12
Vue中computed和watch的區(qū)別小結(jié)
watch和computed都是以Vue的依賴追蹤機(jī)制為基礎(chǔ)的,當(dāng)某一個(gè)依賴型數(shù)據(jù)發(fā)生變化的時(shí)候,所有依賴這個(gè)數(shù)據(jù)的相關(guān)數(shù)據(jù)會(huì)自動(dòng)發(fā)生變化,即自動(dòng)調(diào)用相關(guān)的函數(shù),來(lái)實(shí)現(xiàn)數(shù)據(jù)的變動(dòng),這篇文章簡(jiǎn)單介紹下Vue中computed和watch的區(qū)別異同,感興趣的朋友一起看看吧2022-12-12
vue實(shí)現(xiàn)tab標(biāo)簽(標(biāo)簽超出自動(dòng)滾動(dòng))
當(dāng)創(chuàng)建的tab標(biāo)簽超出頁(yè)面可視區(qū)域時(shí)自動(dòng)滾動(dòng)一個(gè)tab標(biāo)簽距離,并可手動(dòng)點(diǎn)擊滾動(dòng)tab標(biāo)簽,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-05-05
vue3封裝數(shù)字滾動(dòng)組件的實(shí)現(xiàn)示例
本文主要介紹了vue3封裝數(shù)字滾動(dòng)組件的實(shí)現(xiàn)示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2024-08-08
vue項(xiàng)目中一定會(huì)用到的性能優(yōu)化技巧
這篇文章主要為大家介紹了vue項(xiàng)目中一定會(huì)用到的性能優(yōu)化技巧實(shí)例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-07-07
Cookbook組件形式:優(yōu)化 Vue 組件的運(yùn)行時(shí)性能
本文仿照Vue Cookbook 組織形式,對(duì)優(yōu)化 Vue 組件的運(yùn)行時(shí)性能進(jìn)行闡述。通過(guò)基本的示例代碼給大家講解,需要的朋友參考下2018-11-11
前端Vue設(shè)置cookie、刪除cookie,獲取cookie方式
這篇文章主要介紹了前端Vue設(shè)置cookie、刪除cookie,獲取cookie方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10
vue中mock數(shù)據(jù),模擬后臺(tái)接口實(shí)例
這篇文章主要介紹了vue中mock數(shù)據(jù),模擬后臺(tái)接口實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-04-04

