Element-UI el-calendar樣式如何修改日歷
更新時(shí)間:2024年08月06日 09:07:55 作者:A_Hawthorn
這篇文章主要介紹了Element-UI el-calendar樣式如何修改日歷問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
Element-UI el-calendar樣式修改日歷
注:本人水平有限,僅供參考,有所意見和建議歡迎指出
效果展示

代碼實(shí)現(xiàn)
- vue:
<template>
<div class="left_calendar">
<div class="left_calendar_body">
<el-calendar>
<template
slot="dateCell"
slot-scope="{data}">
<div :class="data.isSelected ? 'choseDay' : ''">
<p>
{{ data.day.slice(8) }}
</p>
</div>
</template>
</el-calendar>
</div>
</div>
</template>
<style scoped>
/* 一 二 三 四 五 六 日 */
::v-deep .el-calendar-table thead th {
padding: 0;
font-size: 13px;
color: #9CB2CD;
}
/* 去除邊框 */
::v-deep .el-calendar-table tr td:first-child{
border: none;
}
::v-deep .el-calendar-table tr:first-child td{
border: none;
}
::v-deep .el-calendar-table__row td{
border: none;
}
/* 當(dāng)前月樣式 */
::v-deep .el-calendar-table:not(.is-range){
color: rgba(156, 178, 205, 1);
}
</style>
- css:
.choseDay {
position: relative;
top: -12px;
width: 36px;
height: 36px;
background-color: rgba(83, 143, 255, 1);
color:#fff;
border-radius: 30px;
line-height: 35px;
z-index: 6;
}
.left_calendar {
width: 315px;
height: 395px;
left: 30px;
top: 30px;
position: absolute;
}
.left_calendar_body {
height: 280px;
left: 3px;
top: 85px;
position: absolute;
}
.el-calendar__header .el-calendar__title {
position: absolute;
left: 50%;
transform: translate(-50%);
font: 17px "OPPOSans-R";
color: #273142;
}
.el-calendar-table thead th:before{
color: #9CB2CD;
font-size: 13px;
content: '周';
}
.el-calendar__button-group {
width: 100%;
}
.el-button-group {
display: flex;
justify-content: space-between;
}
.el-button-group::after, .el-button-group::before {
content: unset;
}
.el-button-group>.el-button:not(:first-child):not(:last-child) {
display: none;
}
.el-button-group>.el-button:first-child:before{
content: '<';
}
.el-button-group>.el-button:last-child:before{
content: '>';
}
.el-button-group>.el-button:first-child{
position: relative;
left: -18px;
}
.el-button-group>.el-button:last-child{
position: relative;
left: 210px;
}
.el-button-group>.el-button:first-child span, .el-button-group>.el-button:last-child span{
display: none;
}
.el-calendar .el-calendar-table .el-calendar-day{
padding: 0px;
text-align: center;
font: 13px 'Poppins-Regular';
background-color: rgb(255, 255, 255);
height: 23px;
width: 36px;
}
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
如何理解Vue簡(jiǎn)單狀態(tài)管理之store模式
狀態(tài)管理也就是數(shù)據(jù)狀態(tài)管理,vue應(yīng)用程序的各組件之間經(jīng)常需要進(jìn)行通信,除了v-on、EventBus等通信方式外,可以采用數(shù)據(jù)共享的方式進(jìn)行通信。這種簡(jiǎn)單的數(shù)據(jù)共享模式就是store模式。2021-05-05
Vue3?使用Element?Plus表格單選帶checkbox功能
這篇文章主要介紹了Vue3?使用Element?Plus表格單選帶checkbox,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2023-11-11
vue如何使用moment處理時(shí)間戳轉(zhuǎn)換成日期或時(shí)間格式
這篇文章主要給大家介紹了關(guān)于vue如何使用moment處理時(shí)間戳轉(zhuǎn)換成日期或時(shí)間格式的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者vue具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2022-03-03
在導(dǎo)入.vue文件的時(shí)候,ts報(bào)錯(cuò)提示:找不到模塊“@/Layout/index.vue”或其相應(yīng)的類型聲明問題
這篇文章主要介紹了在導(dǎo)入.vue文件的時(shí)候,ts報(bào)錯(cuò)提示:找不到模塊“@/Layout/index.vue”或其相應(yīng)的類型聲明問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-08-08
小白教程|一小時(shí)上手最流行的前端框架vue(推薦)
這篇文章主要介紹了前端框架vue,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-04-04

