element-plus的el-calendar日历组件使用#date-cell插槽踩坑不生效

使用elementplus的时候发现#date-cell不生效,插槽没有被检测到

 解决方法:这时候只需要将#date-cell改成#dateCell就可以了,修改之后插槽就能用了。

 代码:

<el-calendar ref="calendar" class="aaa">
          <template #header="{ date }">
            <el-button-group>
              <el-button size="small" @click="selectDate('prev-month')">
                <el-icon><CaretLeft /></el-icon>
              </el-button>
            </el-button-group>
            <span>{{ date }}</span>
            <el-button-group>
              <el-button size="small" @click="selectDate('next-month')">
                <el-icon><CaretRight /></el-icon>
              </el-button>
            </el-button-group>
          </template>
          <template #dateCell="{ data }">
            <div @click="clickDay(data)">
              <el-row>
                <el-col class="datastyle">
                  {{ data.day.split("-").slice(2).join("-") }}</el-col
                >
              </el-row>
              <e-row>
                <el-col class="center">
                  <el-tag type="warning" class="tag">
                    <el-row>
                      <el-col :span="17" class="tag">
                        <span>当日限约</span>
                      </el-col>
                      <el-col :span="1"></el-col>
                      <el-col :span="6" class="tag2">
                        <span>500</span>
                      </el-col>
                    </el-row>
                  </el-tag>
                </el-col>
              </e-row>
              <el-row style="margin-top: 10px" class="yuyue">
                <el-col :span="11" class="center">
                  <span>已约</span
                  ><span class="center2" style="">10</span></el-col
                >
                <el-col :span="2" class="center">|</el-col>
                <el-col :span="11" class="center">
                  <span>剩余</span><span class="center2">0</span></el-col
                >
              </el-row>
            </div>
          </template>

 css:

<style scoped>
/deep/.el-calendar__body {
  padding: 4px 20px 35px;
}
/deep/ .el-calendar-table thead th {
  color: #ffab11;
  font-weight: bold;
  font-size: 25px;
}
.tag {
  display: flex;
  align-items: center;
  height: 2.5vh;
  justify-content: center;
}
.tag2 {
  display: flex;
  align-items: center;
  height: 2.5vh;
  justify-content: center;
  font-size: 18px;
}
.aaa .is-selected .yuyue {
  color: #ffab11;
}
.aaa .datastyle {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  color: #353636;
  font-weight: 600;
}
/deep/.el-calendar-table .el-calendar-day:hover {
  background-color: #faecd8;
}
/deep/.el-calendar {
  --el-calendar-selected-bg-color: #faecd8;
}
.aaa .is-selected .datastyle {
  color: #ffab11;
}
.aaa .prev .datastyle {
  color: #c4c5c8;
}
.aaa .next .datastyle {
  color: #c4c5c8;
}
/deep/.el-calendar {
  --el-calendar-cell-width: 130px;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.center2 {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffab11;
  margin-left: 5px;
  font-size: 20px;
}
/deep/.el-calendar__header {
  justify-content: center;
}

效果图:

 

  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
生意参谋-市场大盘,市场排行爬虫脚本,采用pyppeteer+PIL方式处理数值图片问题,人工登录,并将爬取结果保存为csv文件 脚本截取: import asyncio from pyppeteer import launch from PIL import Image import pytesseract import datetime import time import pandas as pd async def main(): start_time = datetime.datetime.now() print('浏览器初始化&hellip;&hellip;') browser = await launch(headless=False, args=['--disable-infobars',f'--window-size=1366,768']) page = await browser.newPage() await page.setViewport({'width': 1366, 'height': 768}) await page.goto('https://login.taobao.com/member/login.jhtml?redirectURL=https://www.taobao.com/') #从淘宝登录 await page.evaluate( '''() =>{ Object.defineProperties(navigator,{ webdriver:{ get: () => false } }) }''') await asyncio.sleep(30) #人工输入账号密码登录 print('开始登录&hellip;&hellip;') await page.goto('https://sycm.taobao.com/mc/mq/overview?cateFlag=2&cateId=50022270&dateType=week') #登录后跳转到生意参谋 await asyncio.sleep(10) #await page.click('#content-container > div.ebase-metaDecorator__root > div > div.ebase-FaCommonFilter__root > div > div > div > div > div.ebase-FaCommonFilter__top > div.ebase-FaCommonFilter__right > div > div > div.oui-date-picker-particle-button > button.ant-btn.oui-canary-btn.ant-btn-primary.ant-btn-sm > span') await page.evaluate( '''() =>{ Object.defineProperties(navigator,{ webdriver:{ get: () => false } }) }''') #uvHits = await page.waitForSelector('#sycm-mc-mq-cate-trend > div.oui-card-content.alife-one-design-sycm-indexes-trend-card-content > div > div.alife-one-design-sycm-indexes-trend-index-container > div > div > div:nth-child(1) > div.alife-one-design-sycm-indexes-trend-index-item-multiple-line-selectable.alife-one-design-sycm-indexes-trend-index-item-uvHits.active > div > div.oui-index-cell-indexValue.oui-num > div > div:nth-child(2) > img') #await uvHits.screenshot({'path': 'uvHits.png'}) #await asyncio.sleep(3) print('开始爬取市场大盘&hellip;&hellip;')

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值