如何预先填充日期范围值?

发布于 2025-02-06 02:57:40 字数 430 浏览 3 评论 0原文

在尝试预填充日期范围值的同时,我在编辑页面上有一个问题。

前任。 2022-06-03,2022-06-04

而不是看到此

”在此处输入图像描述

我在控制台中遇到了一个错误。

I have an issue on my edit page while trying to prepopulate date range value.

Ex. 2022-06-03, 2022-06-04

Rather than see this

enter image description here

I got an error in the console.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぶ宁プ宁ぶ 2025-02-13 02:57:40

我不知道我是否正确理解了这个问题,但是在没有代码段的情况下,我指的是官方Vuetify文档。

基本上,您将日期模式分配给Vuetify组件,并在计算的情况下可选地计算除数。

 export default {
    data: () => ({
      dates: ['2019-09-10', '2019-09-20'],
    }),
    computed: {
      dateRangeText () {
        return this.dates.join(' ~ ')
      },
    },
  }
<v-row>
    <v-col
      cols="12"
      sm="6"
    >
      <v-date-picker
        v-model="dates"
        range
      ></v-date-picker>
    </v-col>
    <v-col
      cols="12"
      sm="6"
    >
      <v-text-field
        v-model="dateRangeText"
        label="Date range"
        prepend-icon="mdi-calendar"
        readonly
      ></v-text-field>
      model: {{ dates }}
    </v-col>
  </v-row>

I don't know if I understood the question correctly, but in the absence of a code snippet I refer to the official Vuetify documentation.

Basically you assign a date pattern to the Vuetify component and optionally, with a computed, calculate the divisor.

 export default {
    data: () => ({
      dates: ['2019-09-10', '2019-09-20'],
    }),
    computed: {
      dateRangeText () {
        return this.dates.join(' ~ ')
      },
    },
  }
<v-row>
    <v-col
      cols="12"
      sm="6"
    >
      <v-date-picker
        v-model="dates"
        range
      ></v-date-picker>
    </v-col>
    <v-col
      cols="12"
      sm="6"
    >
      <v-text-field
        v-model="dateRangeText"
        label="Date range"
        prepend-icon="mdi-calendar"
        readonly
      ></v-text-field>
      model: {{ dates }}
    </v-col>
  </v-row>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文