1.1.5 • Published 4 years ago

@coding-wisely/vue-tailwind-datepicker v1.1.5

Weekly downloads
112
License
MIT
Repository
github
Last release
4 years ago

Vue Tailwind Datepicker

Datepicker component based on Tailwind and Vue

Github All Releases

Vue Tailwind Datepicker

Table of Contents

##Requirements Some prerequesities are required, so i suppose you have tailwind.css and vue.js already in place in your app. If not, first install Tailwind.css and Vue.js.

Getting started

  • Install the plugin:

    Yarn

    yarn add @coding-wisely/vue-tailwind-datepicker

    Npm

    npm install @coding-wisely/vue-tailwind-datepicker

Usage

  • Add VueTailwindDatepicker into your app:

    import VueTailwindDatepicker from 'vue-tailwind-datepicker'
    
    Vue.use(VueTailwindDatepicker)
  • Use the vue-tailwind-datepicker component:

      <vue-tailwind-datepicker />

Installation

npm

  yarn add @coding-wisely/vue-tailwind-datepicker

Then use the component directly:

<!-- your-component.vue-->
<template>
  <vue-tailwind-datepicker v-model="date" @input="setStartDate"></vue-tailwind-datepicker>
</template>
<script>
import { VueTailwindDatepicker } from '@coding-wisely/vue-tailwind-datepicker'

export default {
    components: {
        VueTailwindDatepicker,
    },
    data(){
        return {
            startDate: '',
            form: {}
        }
    },
    methods: {
        setStartDate(startDate) {
            this.form.startDate = startDate;
        }
    }
};
</script>

Browser

Include script into your html page before closing body tag . It must be included after Tailwind.css and Vue.js are loaded.

<script src="https://unpkg.com/@coding-wisely/vue-tailwind-datepicker"></script>

If Vue is detected in the Page, the plugin is installed automatically.

Manually install the plugin into Vue:

Vue.use(VueTailwindDatepicker)

Or use the component directly:

Vue.component('vue-tailwind-datepicker', VueTailwindDatepicker)

Props

Test all props on Code Pen.

IMPORTANT

Props shall be called with hypens.

Example: <vue-tailwind-datepicker picker-wrapper-classess="flex w-full" />

REMEMBER

If you ad props classes, dont forget that defaults on particular props classes will not be applied at all, default will be ignored, and only your, props class will be applied. Means, <vue-tailwind-datepicker input-field-classess="w-full" /> will be applied on input field, and default classes on input field will be ignored.

PropertyTypeDefault valueDescription
pickerWrapperClassesStringw-64CSS class that wraps component
inputFieldClassesStringfocus:outline-none cursor-pointer w-full bg-white h-12 p-3 border-b border-purple-300 text-lg font-medium text-gray-700input field class
pickerMonthSelectionClassesStringflex justify-between h-12 w-full p-2 items-center bg-purple-100 uppercaseDatepicker header class with Month, Year and Previos and Next buttons
pickerDaysHeaderClassesStringflex w-full w-full justify-start text-center p-2Datepicker Days header (Su, Mo, Tu...)
calendarWrapperClassesStringflex w-full border-l border-r border-b border-purple-100 justify-start text-center flex-wrapWrapper around month calendar
selectedDayClassesStringbg-purple-500 text-whiteCSS classes applied on date selected in month calendar
currentDayClassesStringbg-purple-300 text-whiteCSS Classess applied on current date input
chevronClassesStringw-10 h-10CSS classess applied on Previous and Next SVG
dateFormatStringYYYY-MM-DDJavascript moment library date format
preselectedDayString | Javascript moment library date format and it shall match deafult dateFormat above
closeOnClickBooleantrueWhether calendar days will close on click or not

Made with by Coding Wisely.

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago