0

I've been trying to get a datepicker plugin working in my Laravel Spark app with Vuejs.

I've tried adding to app.js:

var datepicker = require('vuejs-datepicker');
Vue.use(datepicker);

But I get

plugin.apply is not a function(…)

in the JS console.

I've also tried:

var datepicker = require('vuejs-datepicker').default;
Vue.use(datepicker);

which yields:

Uncaught TypeError: Cannot read property 'installed' of undefined(…)

Am I being dumb? As I can't find any references to my errors in this context.

Joe
  • 4,618
  • 3
  • 28
  • 35

1 Answers1

0

I normally import this into a parent component .vue file e.g

<script>
import Datepicker from 'vuejs-datepicker'

export default {
   components: {
      Datepicker
   }
}
</script>

<template>
   <datepicker></datepicker>
</template>
charliefarley321
  • 162
  • 3
  • 15