orlyyani / read-more

A Vue.js read more plugin
MIT License
110 stars 34 forks source link

Failed to mount component #3

Open liolios opened 6 years ago

liolios commented 6 years ago

Hi, Im getting this error when trying to use the component approach. Is there something I'm doing wrong when importing the component?

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

found in

--> ReadMore ReadMoreComponent at resources/assets/js/components/read-more-component.vue Home at resources/assets/js/views/Home.vue Root

Thanks!

pfasang commented 6 years ago

Hi @liolios , problem in your code is, that you are calling read-more plugin as a component, not as a plugin. In your main.js paste these two lines of code.

import ReadMore from 'vue-read-more'
Vue.use(ReadMore)

And then in your component simply use tag.

jomofrodo commented 5 years ago

Thanks. That wasn't clear to me either. Working now :)