当前位置: 首页 > ai >正文

uniapp自定义日历计划写法(vue2)

文章目录

  • uniapp自定义日历计划写法(vue2)
    • 1、效果
    • 2、实现源码

  • 前言:我们有时候需要实现的日历找不到相应的插件的时候,往往需要手动去写一个日历,以下就是我遇到这样的问题时,手搓出来的一个解决方案,希望可以帮助到更多的人。创作不易,请多多支持

uniapp自定义日历计划写法(vue2)

1、效果

在这里插入图片描述
在这里插入图片描述

2、实现源码

  • 创建calendar组件
<template><!-- 左右滑动切换月份 --><view @touchstart="handleTouchStart" @touchend="handleTouchEnd"><!--  <view class="titleBox"><view class="title">{{ currentYear }}.{{ currentMonth }}</view></view> --><view class="calendarDiv"><view class="cpc_week"><view class="week_day" v-for="(item,index) in week" :key="index">{{ item }}</view></view><view class="calendar_box"><viewclass="calendar_day" v-for="(item, index) in currentMonthAllDate" :key="index" @tap="selectedDate(item.date)"><view :class="[item.month == 'current' ? 'current_day':'']" class="calendar_day_number_div"><view class="day_number" :class="[(item.month == 'current' && currentToday == item.date) ? 'currentToday':'']">{{item.number}}</view></view><view class="date_plan" v-if="item.isPlan != null && item.isPlan"><view class="cpc_point" v-for="(item_plan,plan_index) in item.planTypes" :index="plan_index" :class="[(item_plan === 1 ? 'plan1':''),(item_plan === 2 ?'plan2':''),(item_plan === 3 ?'plan3':''),(item_plan === 4 ?'plan4':'')]"></view></view></view><view class="showBorderParent"><view class="showBorder" @tap="changeShowWeekOrMonth"></view></view></view></view></view></template><script>
export default {name: 'Calendar'
http://www.xdnf.cn/news/6480.html

相关文章:

  • 生信分析进阶15 - 从GTF文件提取起始密码子、终止密码子、外显子剪切供体和受体
  • 基于大模型的脑出血智能诊疗与康复技术方案
  • 计算机组成原理——数据的表示
  • 使用 Docker 部署 React + Nginx 应用教程
  • 4.2.3 Thymeleaf标准表达式 - 5. 片段表达式
  • mac M芯片运行docker-desktop异常问题
  • 保姆教程-----安装MySQL全过程
  • minio存储文件迁移磁盘
  • SpringBoot + Shiro + JWT 实现认证与授权完整方案实现
  • 《k-means 散点图可视化》实验报告
  • 在服务器上安装AlphaFold2遇到的问题(3)_cat: /usr/include/cudnn_version.h: 没有那个文件或目录
  • 从概念到可工程化智能体的转变路径——以“知识奇点工程师”为例
  • Secs/Gem第四讲(基于secs4net项目的ChatGpt介绍)
  • Python零基础入门到高手8.4节: 元组与列表的区别
  • 深度学习中--模型调试与可视化
  • 易境通海外仓WMS系统:赋能海外仓多元化业务场景管理
  • 【通知】2025元宇宙数字人设计大赛启动,大赛线上报名阶段开启!
  • ROOM 数据库 | 实现自定义 ContentProvider 具有条件的批量删除、查询功能
  • 傻子学编程之——Java并发编程的问题与挑战
  • WHAT - 前端开发流程 SOP(标准操作流程)参考
  • 芋道项目,商城模块数据表结构
  • NetSuite CSV导入Item Fulfillment的功能测试
  • ruskal 最小生成树算法
  • CPU cache基本原理
  • 互联网大厂Java求职面试:AI与大模型集成的云原生架构设计
  • 崩坏星穹铁道风堇前瞻养成攻略 崩坏星穹铁道风堇配队推荐
  • 【25软考网工】第六章 (6)防火墙技术、IDS入侵检测系统和IPS入侵防御系统
  • pytest 框架-第一集:初识
  • 3.2.4 掌握RDD行动算子
  • 周赛好题推荐