Using vue-paypal-checkout with Nuxt.js as a plugin
robinscholz opened this issue · comments
Robin Scholz commented
I'm currently trying to implement vue-paypal-checkout as a nuxt plugin, but can’t get it to work.
/plugins/vue-paypal.js
import Vue from 'vue'
import PayPal from 'vue-paypal-checkout'
Vue.use(PayPal, {name: 'paypal'})
nuxt.config.js
plugins: [
{ src: '~/plugins/vue-paypal.js', ssr: false }
]
Console error
[Vue warn]: Unknown custom element: <paypal> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Any idea why this is not working?
Robin Scholz commented
Solved with /plugins/vue-paypal.js
:
import Vue from 'vue'
import paypal from 'vue-paypal-checkout'
Vue.component('paypal', paypal)