Vue2-datepicker: How to use this datepicker via CDN?

Created on 25 Apr 2018  路  2Comments  路  Source: mengxiong10/vue2-datepicker

I tried to load it via CDN:

  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/build.min.js"></script>
  <script type="text/javascript">
    Vue.use(DatePicker);
    var vm = new Vue({
      el: '#app',
      components: { DatePicker },
      data: {
        startDate: '',
      },
      computed: {

      },
      mounted() {

      },
      methods: {

      }
    });
  </script>

Then add the following to html:

<date-picker v-model="criteriaStartDate" lang="en" type="datetime" format="yyyy-MM-dd hh:mm:ss" confirm></date-picker>

When I tried to load the page, I saw error message in console:

found in
--->

I really like this tool, but would much appreciate if there is way to use it via CDN.

Most helpful comment

Vue.use(DatePicker.default);

All 2 comments

Vue.use(DatePicker.default);

It works now. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lequy1010 picture lequy1010  路  5Comments

makowy picture makowy  路  3Comments

MaxDiMart picture MaxDiMart  路  5Comments

musman92 picture musman92  路  4Comments

ajithsimon picture ajithsimon  路  4Comments