【Vuetify】日期和时间选择器(vuetify-datetime-picker)

Chason
2022-01-12 / 0 评论 / 0 点赞 / 764 阅读 / 1,614 字
温馨提示:
本文最后更新于 2022-01-12,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

vuetify-datetime-picker

demo:

https://darrenfang.github.io/vuetify-datetime-picker/
image.png

code:

https://github.com/darrenfang/vuetify-datetime-picker
vuetify-datetime-picker

vuetify-datetime-picker

GitHub license
npm version
CircleCI

DatetimePicker component for Vuetify.js.

Online Demo

Demo Source Code

Installation

npm install --save vuetify-datetime-picker

or

yarn add vuetify-datetime-picker
import Vue from 'vue'
import DatetimePicker from 'vuetify-datetime-picker'
// (Optional) import 'vuetify-datetime-picker/src/stylus/main.styl'

Vue.use(DatetimePicker)

If use the main.styl, you should configure the stylus-loader in webpack.config.js, or just ignore this style sheet.

Usage

Once installed, it can be used in a template as simply as:

<v-datetime-picker label="Select Datetime" v-model="datetime"> </v-datetime-picker>

Properties

NameTypeDefault ValueDescription
datetime (model)Date/String Time picker model.
disabledBooleanfalseInput is disabled.
loadingBooleanfalseInput is loading.
labelstring Sets input label.
dialogWidthNumber340The width of the dialog.
dateFormatstringyyyy-MM-ddDefines the format of a date.
timeFormatstringHH:mmDefines the format of a time.
clearTextstringCLEARSets the text of the clear button.
okTextstringOKSets the text of the ok button.
textFieldPropsObject Text fields properties. See Vuetify Docs
datePickerPropsObject Date pickers properties.See Vuetify Docs
timePickerPropsObject Time pickers properties.See Vuetify Docs

Events

NameArgumentsDescription
inputvalue (Date/String)The updated bound model

Slots

NameDescription
dateIconSlot to put custom icon in the date tab.
timeIconSlot to put custom icon in the time tab.
actionsSlot to put custom buttons in the dialog.
progressSlot for custom progress linear (displayed when loading prop is not equal to Boolean False)
0

评论区