如何实现 Vuetify 日期选择器

How to implement Vuetify date picker

我正在尝试使用 Vuetify 的日期选择器。添加取自 vuetify 的模板后出现错误。

错误:[Vue 警告]:道具无效:道具“已禁用”的类型检查失败。应为布尔值,得到值为“true”的字符串。

代码:

           <v-col cols="12" md="3">
                 <v-menu
                  v-model="menu2"
                  :close-on-content-click="false"
                  :nudge-right="40"
                  transition="scale-transition"
                  offset-y
                  min-width="auto"
                  
                >
                  <template v-slot:activator="{ on, attrs }">
                    <v-text-field
                     
                      v-model="date"
                      label="Picker without buttons"
                      prepend-icon="mdi-calendar"
                      readonly
                      v-bind="attrs"
                      v-on="on"
                    ></v-text-field>
                  </template>
                  <v-date-picker
                    v-model="date"
                    @input="menu2 = false"
                  ></v-date-picker>
                </v-menu>
              </v-col>  




 date: (new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).toISOString().substr(0, 10),        
    menu2: false,

阅读错误,它会告诉你到底出了什么问题。 disabled 需要一个布尔值。您向它传递了一个字符串,为了使其成为布尔值,您需要绑定它。您提供的代码不是导致错误的原因。

在您的代码中的其他地方检查

disabled="true"

并将其更改为

:disabled="true"