Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[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

like image 858
Omid Sadeghi Avatar asked Mar 03 '26 00:03

Omid Sadeghi


1 Answers

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

I should have used vuePersianDatetimePicker.default instead of vuePersianDatetimePicker

like image 89
Omid Sadeghi Avatar answered Mar 04 '26 14:03

Omid Sadeghi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!