npmvue.jspersian-calendar

[Vue warn]: Failed to mount component: template or render function not defined


I want to use an npm module which is based on Vue:

Persian Date & Time Picker For Vue.js

because I'm not familiar with node.js, I used wzrd.in to get a window.vuePersianDatetimePicker object:

https://wzrd.in/standalone/vue-persian-datetime-picker@latest

I used it in my code(I only include contents of my body tag):

<div id="app">       
    <date-picker></date-picker>
</div>


<script src="vue.js"></script>
<script src='https://wzrd.in/standalone/vue-persian-datetime-picker@latest'></script>
<script>
    Vue.component('date-picker',vuePersianDatetimePicker)
    new Vue({
        el: "#app",
        });
</script>

but I cannot use it and get the following error:

[Vue warn]: Failed to mount component: template or render function not defined.

enter image description here


Solution

  • I looked at the contents of vuePersianDatetimePicker object and found the solution.

    I should have used vuePersianDatetimePicker.default instead of vuePersianDatetimePicker