Element-UI el-calendar樣式如何修改日歷
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 3集成??礧eb插件實(shí)現(xiàn)視頻監(jiān)控功能
本文詳細(xì)介紹了如何使用 Vue 3 框架集成??礧eb插件實(shí)現(xiàn)視頻監(jiān)控功能,通過定義屬性、事件、變量,以及編寫初始化、播放視頻、處理節(jié)點(diǎn)點(diǎn)擊事件等方法,我們成功實(shí)現(xiàn)了視頻監(jiān)控系統(tǒng)的前端部分,感興趣的朋友一起看看吧2024-11-11
vue.js異步上傳文件前后端實(shí)現(xiàn)代碼
這篇文章主要為大家詳細(xì)介紹了vue.js異步上傳文件前后端的實(shí)現(xiàn)代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-08-08
el-elementUI使用el-date-picker選擇年月
本文主要介紹了el-elementUI使用el-date-picker選擇年月,文中通過示例代碼介紹的非常詳細(xì),需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2024-02-02
Vue Promise解決回調(diào)地獄問題實(shí)現(xiàn)方法
這篇文章主要介紹了Vue Promise解決回調(diào)地獄問題,總的來說這并不是一道難題,那為什么要拿出這道題介紹?拿出這道題真正想要傳達(dá)的是解題的思路,以及不斷優(yōu)化探尋最優(yōu)解的過程。希望通過這道題能給你帶來一種解題優(yōu)化的思路2023-01-01
vue實(shí)現(xiàn)隨機(jī)驗(yàn)證碼功能(完整代碼)
驗(yàn)證碼功能在我們的身邊用處極廣,今天小編給大家分享基于vue實(shí)現(xiàn)隨機(jī)驗(yàn)證碼功能,感興趣的朋友跟隨小編一起看看吧2019-12-12
一文了解Vue 3 的 generate 是這樣生成 render&n
本文介紹generate階段是如何根據(jù)javascript AST抽象語法樹生成render函數(shù)字符串的,本文中使用的vue版本為3.4.19,感興趣的朋友跟隨小編一起看看吧2024-06-06
vue列表單項(xiàng)展開收縮功能之this.$refs的詳解
這篇文章主要介紹了vue列表單項(xiàng)展開收縮功能之this.$refs的詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05
利用Vue v-model實(shí)現(xiàn)一個(gè)自定義的表單組件
本篇文章主要介紹了利用Vue v-model實(shí)現(xiàn)一個(gè)自定義的表單組件的相關(guān)知識。具有很好的參考價(jià)值。下面跟著小編一起來看下吧2017-04-04
完美解決vue 中多個(gè)echarts圖表自適應(yīng)的問題
這篇文章主要介紹了完美解決vue 中多個(gè)echarts圖表自適應(yīng)的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-07-07

