Git Product home page Git Product logo

Comments (10)

pany-ang avatar pany-ang commented on August 19, 2024

你这应该是你业务代码的问题,多仔细检查检查

from v3-admin-vite.

xuergo avatar xuergo commented on August 19, 2024

你这应该是你业务代码的问题,多仔细检查检查

作者你好,感谢回复, 我又试了一下 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.

pany-ang avatar pany-ang commented on August 19, 2024

完整代码贴出来看看

from v3-admin-vite.

xuergo avatar xuergo commented on August 19, 2024

完整代码贴出来看看

<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.

pany-ang avatar pany-ang commented on August 19, 2024

value1 的类型错了

from v3-admin-vite.

pany-ang avatar pany-ang commented on August 19, 2024

稍等,你的代码好像没有问题

from v3-admin-vite.

pany-ang avatar pany-ang commented on August 19, 2024

这似乎是 Element Plus 的问题,等待它的新版修复这个问题吧,目前的话可以暂时将类型断言为 any

from v3-admin-vite.

xuergo avatar xuergo commented on August 19, 2024

这似乎是 Element Plus 的问题,等待它的新版修复这个问题吧,目前的话可以暂时将类型断言为 any

好的 感谢回复

from v3-admin-vite.

pany-ang avatar pany-ang commented on August 19, 2024

as ModelValueType 断言为 Element Plus 自带的 ModelValueType 类型比较准确

from v3-admin-vite.

xuergo avatar xuergo commented on August 19, 2024

as ModelValueType 断言为 Element Plus 自带的 ModelValueType 类型比较准确

好的 多谢回复

from v3-admin-vite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.