Created
June 1, 2017 01:22
-
-
Save chmln/e77b52cf0a719e18233ca7948be8fab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Flatpickr from "flatpickr"; | |
import Vue from "vue"; | |
// <input type="text" v-flatpickr="{'enableTime': true}" | |
Vue.directive("flatpickr", { | |
bind: (el, binding) => { | |
el._flatpickr = new Flatpickr(el, binding.value); | |
}, | |
unbind: el => el._flatpickr.destroy() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment