Comments (10)
你这应该是你业务代码的问题,多仔细检查检查
from v3-admin-vite.
你这应该是你业务代码的问题,多仔细检查检查
作者你好,感谢回复, 我又试了一下 clone 了你的最新代码 然后 复制上面的代码覆盖了login.vue 还是一样的。上面的代码应该没有问题这是elemtuiPlus 的官方demo http://element-plus.org/zh-CN/component/datetime-picker.html#%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E6%A0%BC%E5%BC%8F
from v3-admin-vite.
完整代码贴出来看看
from v3-admin-vite.
完整代码贴出来看看
<template>
<div class="block">
<span class="demonstration">Default</span>
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="To"
start-placeholder="Start date"
end-placeholder="End date"
/>
</div>
<div class="block">
<span class="demonstration">With shortcuts</span>
<el-date-picker
v-model="value2"
type="datetimerange"
:shortcuts="shortcuts"
range-separator="To"
start-placeholder="Start date"
end-placeholder="End date"
/>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const value1 = ref([
new Date(2000, 10, 10, 10, 10),
new Date(2000, 10, 11, 10, 10),
])
const value2 = ref('')
const shortcuts = [
{
text: 'Last week',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
},
},
{
text: 'Last month',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
},
},
{
text: 'Last 3 months',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
},
},
]
</script>
<style scoped>
.block {
padding: 30px 0;
text-align: center;
border-right: solid 1px var(--el-border-color);
flex: 1;
}
.block:last-child {
border-right: none;
}
.block .demonstration {
display: block;
color: var(--el-text-color-secondary);
font-size: 14px;
margin-bottom: 20px;
}
</style>
from v3-admin-vite.
value1 的类型错了
from v3-admin-vite.
稍等,你的代码好像没有问题
from v3-admin-vite.
这似乎是 Element Plus 的问题,等待它的新版修复这个问题吧,目前的话可以暂时将类型断言为 any
from v3-admin-vite.
这似乎是 Element Plus 的问题,等待它的新版修复这个问题吧,目前的话可以暂时将类型断言为 any
好的 感谢回复
from v3-admin-vite.
as ModelValueType
断言为 Element Plus 自带的 ModelValueType 类型比较准确
from v3-admin-vite.
as ModelValueType
断言为 Element Plus 自带的 ModelValueType 类型比较准确
好的 多谢回复
from v3-admin-vite.
Related Issues (20)
- 怎么感觉meta.hidden不能用?是我使用方法有问题? HOT 4
- 推荐将sass的@import都改为官方推荐的@use HOT 2
- 接口404
- 为什么“是否开启动态路由功能”的变量名是async而不是dynamic HOT 1
- 开启全屏后顶部存在一个margin HOT 8
- 项目启动错误, Cannot find package 'fast-glob' HOT 3
- 接口报错了 HOT 1
- 登录页增加背景图片 HOT 1
- 权限指令写法有问题 HOT 1
- 表格高度撑满自适应问题 HOT 1
- 表格固定后,透明了 HOT 1
- 更新到最新后自定义主题好像不生效了 HOT 2
- iPhone 手机用浏览器访问本地开发环境在登录成功之后白屏 HOT 5
- 这个页面好多黄色波浪线警告 HOT 1
- serive 流式接口 HOT 1
- 为什么模块和组件都正常的引入也可以使用,但编辑器一直报找不到模块呢 HOT 1
- 页签问题 HOT 1
- multi-language support HOT 1
- 首页第一次加载时不触发 onActivated 钩子
- Group && 交流群 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v3-admin-vite.