You have to require('datepicker') in .vue component.
I'll give you example here, i just download datepicker plugin from github & let me know if this one is you used there.
I used bootstrap.js, dashboard.js (cant be anything for you), and 'datepicker.min.js' where i put in resources/assets/js/ folder & stylesheet files dashboard.scss in resources/assets/sass/ folder.
bootstrap.js
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
dashboard.js
const Vue = require('vue')
Vue.component('example', require('./../components/Example.vue'))
new Vue({
el: '#app'
});
Example.vue
<template>
<div class="col mt-5">
<div class="row" style="margin-top: 200px">
<input id="date">
</div>
</div>
</template>
<script>
require('./../datepicker.min'); // depend on your folder structure;
export default {
mounted() {
$('#date').datepicker()
}
}
</script>
dashboard.scss
@import "../datepicker.min.css"; // depend on your folder structure
Compile the asset with nm run dev or npm run prod. Then include the script with order app.js & then dashboard.js and of course the stylesheet.
And then voila, we gate datepicker on the page. Here is the screenshot
Hope this will work for you.