cocoastorm / vue-paypal-checkout

A simple Vue.js wrapper component for paypal-checkout

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using vue-paypal-checkout with Nuxt.js as a plugin

robinscholz opened this issue · comments

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?

Solved with /plugins/vue-paypal.js:

import Vue from 'vue'
import paypal from 'vue-paypal-checkout'

Vue.component('paypal', paypal)