Python私教张大鹏 Vue3整合AntDesignVue之DatePicker 日期选择框

案例:选择日期

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择周

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" picker="week"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择月

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" picker="month"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择季度

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" picker="quarter"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择年份

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" picker="year"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择日期区间

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择日期时间区间

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" show-time/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择周区间

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" picker="week"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择月区间

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" picker="month"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:选择年区间

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" picker="year"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:日期格式

<script setup>
import {ref} from "vue";const date = ref(null)
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" format="YYYY年MM月DD日"/><a-divider/><a-typography-title>{{ date}}</a-typography-title></div>
</template>

在这里插入图片描述

案例:预设日期

<script setup>
import {ref} from "vue";
import dayjs from "dayjs"const date = ref(null)
const presets = [{label: "昨天",value: dayjs().add(-1, 'd')},{label: "上周",value: dayjs().add(-7, 'd')},{label: "上月",value: dayjs().add(-1, 'month')}
]
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" :presets="presets"/><a-divider/><a-typography-title>{{ date }}</a-typography-title></div>
</template>

在这里插入图片描述

案例:预设日期区间

<script setup>
import {ref} from "vue";
import dayjs from "dayjs"const date = ref(null)
const presets = [{label: "最近一周",value: [dayjs().add(-7, 'd'), dayjs()]},{label: "最近半月",value: [dayjs().add(-15, 'd'), dayjs()]},{label: "最近一月",value: [dayjs().add(-1, 'month'), dayjs()]}
]
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" :presets="presets"/><a-divider/><a-typography-title>{{ date }}</a-typography-title></div>
</template>

在这里插入图片描述

案例:日期选中事件

<script setup>
import {ref} from "vue";const date = ref(null)
const onChange = (date, dateStr) => {console.log(date)console.log(dateStr)
}
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-date-picker v-model:value="date" @change="onChange"/><a-divider/><a-typography-title>{{ date }}</a-typography-title></div>
</template>

在这里插入图片描述

案例:日期区间选中事件

<script setup>
import {ref} from "vue";const date = ref(null)
const onChange = (dates, dateStrs) => {console.log(dates)console.log(dateStrs)
}
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" @change="onChange"/><a-divider/><a-typography-title>{{ date }}</a-typography-title></div>
</template>

在这里插入图片描述

案例:显示中文

<script setup>
import {ref} from "vue";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN"const date = ref(null)
const onChange = (dates, dateStrs) => {console.log(dates)console.log(dateStrs)
}
</script>
<template><div class="p-8 bg-indigo-50 text-center"><a-range-picker v-model:value="date" @change="onChange" :locale="locale"/><a-divider/><a-typography-title>{{ date }}</a-typography-title></div>
</template>

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/852050.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Day50 代码随想录打卡|二叉树篇---验证二叉搜索树

题目&#xff08;leecode T98&#xff09;&#xff1a; 给你一个二叉树的根节点 root &#xff0c;判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下&#xff1a; 节点的左子树只包含 小于 当前节点的数。节点的右子树只包含 大于 当前节点的数。所有左子树和右…

unity开发Hololens编辑器运行 按空格没有手

选择DictationMixedRealityInputSystemProfile 如果自定义配置文件 需要可能需要手动设置 手部模型和材质球

Centos: ifconfig command not found且ip addr查不到服务器IP

前段时间部门新派发了服务器&#xff0c;让我过去使用U盘装机&#xff0c;装完后使用ifconfig查不到服务器IP地址&#xff0c;ip addr也是查不到 ifconfig&#xff1a;command not found (这两个图片先用虚拟机的替代一下) 在网上找资料(CSDN&#xff0c;博客园&#xff0c;知乎…

使用 Vue 和 Ant Design 实现抽屉效果的模块折叠功能

功能描述&#xff1a; 有两个模块&#xff0c;点击上面模块的收起按钮时&#xff0c;上面的模块可以折叠&#xff0c;下面的模块随之扩展 代码实现&#xff1a; 我们在 Vue 组件中定义两个模块的布局和状态管理&#xff1a; const scrollTableY ref(560); // 表格初始高度…

分类模型:MATLAB判别分析

1. 判别分析简介 判别分析&#xff08;Discriminant Analysis&#xff09; 是一种统计方法&#xff0c;用于在已知分类的样本中构建分类器&#xff0c;并根据特征变量对未知类别的样本进行分类。常见的判别分析方法包括线性判别分析&#xff08;Linear Discriminant Analysis, …

人工智能的潜在威胁:罗曼·扬波尔斯基对AGI的警示

随着科技的飞速发展&#xff0c;人工智能&#xff08;AI&#xff09;技术正迅速成为人类社会不可或缺的一部分。然而&#xff0c;随着人工智能技术的发展&#xff0c;一些科学家对其潜在的危险表示了担忧。本文将深入探讨计算机科学家罗曼扬波尔斯基对人工智能特别是人工通用智…

Python学习笔记7:入门知识(七)

前言 之前说过我更换了新的学习路线&#xff0c;现在是根据官方文档和书籍Python crash course来进行学习的&#xff0c;在目前的学习中&#xff0c;对于之前的知识有一些遗漏&#xff0c;这里进行补充。 学习资料有两个&#xff0c;书籍中文版PDF&#xff0c;关注我私信发送…

Joplin Typora 粘贴图片 | 当使用Typora作为Joplin编辑器时,如何粘贴图片并上传到Joplin服务器,替换链接

一、背景 当我们使用Joplin时&#xff0c;上传图片时会自动上传到Joplin服务器并替换链接 但是Joplin的编辑器不好用&#xff0c;我更习惯用Typora来编辑&#xff0c; 然而Typora中上传的图片只能在本地&#xff0c;无法上传到Joplin服务器&#xff0c;在其他客户端也看不到图片…

C#——方法函数详情

方法(函数) C#是面向对象的,所以C#中的方法也是相对于对象来说的,是指某个对象的行为,比如,有一个动物的类,兔子是这个动物类里的一个对象,那么跳这个行为就是兔子这个对象的方法了.其实也就是C中的函数(C是面向过程的,叫函数). 方法: 就是把一系列相关的代码组织到一块 用于…

语法07 C++ 程序中的除法和求余

程序中的除法 int / int int double / int double int / double double double / double double 规律总结 只要除号任意一边出现了double类型&#xff0c;结果就是double类型 只有除号两边都是int类型&#xff0c;结果才是int类型 这个规律也适用于加法减法和乘法 …

服务器端渲染(SSR)

什么是服务器端渲染 ssr SSR 的全称是 Server Side Rendering&#xff0c;对应的中文名称是:服务端渲染&#xff0c;也就是将页面的 html 生成工作放在服务端进行。 网页通常是通过后端路由直接给客户端的。也就是说网页的html一般是后端服务器里通过模板引擎渲染好后再交给前…

操作系统入门系列-MIT6.828(操作系统工程)学习笔记(七)---- 系统调用函数与GDB(Lab: system calls)

系列文章目录 操作系统入门系列-MIT6.828&#xff08;操作系统工程&#xff09;学习笔记&#xff08;一&#xff09;---- 操作系统介绍与接口示例 操作系统入门系列-MIT6.828&#xff08;操作系统工程&#xff09;学习笔记&#xff08;二&#xff09;---- 课程实验环境搭建&am…

Python 围棋游戏【含Python源码 MX_008期】

简介&#xff1a; 围棋&#xff0c;源自中国&#xff0c;是一种两人对弈的策略棋类游戏。它被认为是世界上最复杂的棋类游戏之一&#xff0c;因为它的规则简单&#xff0c;但变化复杂多样。围棋的游戏目标是在棋盘上占领更多的地盘&#xff0c;并用自己的棋子围住对手的棋子&am…

docker-compose harbor 2.11

harbor 前言 “Harbor” 是一个用于管理容器镜像的开源仓库项目。由 VMware 开发和维护,Harbor 提供一个企业级的 Docker 镜像仓库,具有丰富的功能,包括: 镜像管理:提供存储和分发 Docker 镜像的能力。安全性:支持镜像签名和漏洞扫描,确保镜像的安全性。身份认证:集成…

41 mysql subquery 的实现

前言 sub query 是一个我们经常会使用到的一个 用法 我们这里 看一看各个场景下面的 sub query 的相关处理 查看 本文, 需要 先看一下 join 的相关处理 测试数据表如下, 两张测试表, tz_test, tz_test03, 表结构 一致 CREATE TABLE tz_test (id int(11) unsigned NOT NUL…

QT调用vs2019生成的c++动态库

QT调用vs2019生成的c动态库 dll库的创建方法&#xff1a; VS2019创建c动态链接库dll与调用方法-CSDN博客 加减法示范&#xff1a; 头文件 // 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DLL3_EXPORTS // 符号编…

SurfaceView->SurfaceView基本概念

绘制过程 View和SurfaceView绘制过程 PhoneWindow&#xff1a;Window的具体实现&#xff0c;在Activity中调用setContentView()方法时&#xff0c;一个PhoneWindow实例会对应一个ViewRootImpl实例&#xff0c;绘制&#xff0c;事件分发传递给ViewRootImpl进行ViewRootImpl&…

少样本学习元学习

基本概念 首先是机器学习&#xff1a; 然后&#xff0c;什么是元学习&#xff08;what is meta learning?) 之前&#xff0c;Component都是让人自己设置的。在Meta Learning中&#xff0c;我们期望它能够自己学出来。 不同的meta learning方法就是想办法去学learning algori…

【面向就业的Linux基础】从入门到熟练,探索Linux的秘密(二)

主要内容介绍可tmux和vim的一些常用操作&#xff0c;可以当作笔记需要的时候进来查就行。 文章目录 前言 一、tmux和vim 二、Linux系统基本命令 1.tmux教程 2. vim教程 3.练习 总结 前言 主要内容介绍可tmux和vim的一些常用操作&#xff0c;可以当作笔记需要的时候进来查就行…

javaWeb项目-ssm+vue中国风音乐推介网站功能介绍

本项目源码&#xff1a;java-ssmvue中国风音乐推介网站源码说明文档资料资源-CSDN文库 项目关键技术 开发工具&#xff1a;IDEA 、Eclipse 编程语言: Java 数据库: MySQL5.7 框架&#xff1a;ssm、Springboot 前端&#xff1a;Vue、ElementUI 关键技术&#xff1a;springboot、…