Reputation: 3674
I try to inject a function inside my plugin
plugin.js
import Vue from 'vue'
import mediumZoom from 'medium-zoom'
Vue.prototype.$mediumZoom = mediumZoom()
When I try to load my page it keeps loading infinite and the page in the end doesnt react, it looks like this:
Upvotes: 3
Views: 536
Reputation: 193261
It's because you are calling mediumZoom
on page load. You probably want:
Vue.prototype.$mediumZoom = mediumZoom
// don't call function, no () here ---^
Upvotes: 2