Home>

Please write your question in detail here.
I want to use datepiker with Vue.js + Rails, but I'm almost in trouble with Uncaught Error: Cannot find module"pikaday"This page is for reference.
https://enrian.github.io/vue-pikaday/guide/installation.html

I'm doing this, but it doesn't work for some reason.
Thanks for your answer.

Error message
vue-pikaday.js: 1 Uncaught Error: Cannot find module "pikaday"
    at webpackMissingModule (vue-pikaday.js: 1)
    at vue-pikaday.js: 1
    at Object.<anonymous>(vue-pikaday.js: 1)
    at Object.<anonymous>(vue-pikaday.js: 2)
    at __webpack_require__ (bootstrap 39f035acf474c34c6376: 19)
    at Object.<anonymous>(todo.js: 1)
    at __webpack_require__ (bootstrap 39f035acf474c34c6376: 19)
    at bootstrap 39f035acf474c34c6376: 62
    at bootstrap 39f035acf474c34c6376: 62
webpackMissingModule @ vue-pikaday.js: 1
(anonymous) @ vue-pikaday.js: 1
(anonymous) @ vue-pikaday.js: 1
(anonymous) @ vue-pikaday.js: 2
__webpack_require__ @ bootstrap 39f035acf474c34c6376: 19
(anonymous) @ todo.js: 1
__webpack_require__ @ bootstrap 39f035acf474c34c6376: 19
(anonymous) @ bootstrap 39f035acf474c34c6376: 62
(anonymous) @ bootstrap 39f035acf474c34c6376: 62
Applicable source code
<template>
    <vue-pikaday
            v-model = "now"
            placeholder = "Pick a date"
            @ focus = "triggerFocus ()"
            @ blur = "triggerBlur ()"
    />
</template>
<script>
    import '@ enrian/vue-pikaday';
    export default {
        data () {
            return {
                now: null
            }
        },
        methods: {
            triggerFocus () {
                console.log ('focus triggered');
            },
            triggerBlur () {
                console.log ('blur triggered')
            }
        }
    }
</script>
import Vue from 'vue/dist/vue.esm.js'
import VuePikaday from '@ enrian/vue-pikaday';
Vue.use (VuePikaday);
var app = new Vue ({
    el: '#app',
    components: {
      'navbar': Header,
    }
});
# datepicker-default.form-group
  label.col-sm-3.control-label
    | Default
  .col-sm-9.form-inline
    .input-group.date
      input.form-control [type = "text" value = "20170621"]
      .input-group-addon
        i.fa.fa-calendar
# date-picker
  input
#app
  navbar
= javascript_pack_tag 'todo'
javascript:
  $(function () {
      // Default
      $('# datepicker-default .date'). datepicker ({
          format: "yyyy mm month dd day",
          language: 'ja',
          autoclose: true
      });
  });
  $('# datepicker'). datepicker ();