How to use open() on vuejs
See original GitHub issueI’m submitting a … (check one with “x”)
[x] How to trigger open() on vuejs
Tell about your platform
- flatPickr version : 4.0.0
- Vue.js version : 2.1.10
- Browser name and version : Chrome
- This package version : 4.0.0
Current behavior NONE
Expected behavior Trigger flatpickr with custom button
Minimal reproduction of the problem with instructions
Below is my code:
Index.vue
<template>
<div>
<button @click="chooseBooking" class="btn btn-pink">Book Now</button>
</div>
</template>
<script>
import flatPickr from 'vue-flatpickr-component';
import 'flatpickr/dist/flatpickr.css';
import 'flatpickr/dist/themes/material_blue.css'
export default {
components: {
flatPickr
},
data(){
date: new Date()
},
methods: {
chooseBooking(){
// Trigger flatpickr
}
}
}
</script
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Quick Start - Vue.js
Quick Start #. Try Vue Online #. To quickly get a taste of Vue, you can try it directly in our Playground. If...
Read more >Creating a Vue.js File Reader Component Using the ...
In this tutorial you'll learn how to use the FileReader API in order to load text from a file and how to style...
Read more >Vue JavaScript Tutorial in Visual Studio Code
Put the cursor over the App , right click and select Peek Definition. A Peek window will open showing the App definition from...
Read more >vue.js - Vue replaces "open" attribute to value "open" in any tag
I was using it along with jQuery, but you can easily substitute with vue.js' $el . This is what it looks in my...
Read more >Getting Started with VueJS - Medium
You're in your first VueJS app! Our Project Files. Open your project directory your preferred text editor. Let's take a look at what...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To access the flatPicker methods you need to add a
ref
to the<flat-pickr ref="myRef">
.Then access the ref
this.$refs.myRef
And access the fp instance on that ref
this.$refs.myRef.fp
And you can call
.open()
on that.this.$refs.myRef.fp.open()