Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding plugin to nuxt using the formulate.config.js file #1

Open
andyfensham opened this issue Apr 23, 2021 · 1 comment
Open

Adding plugin to nuxt using the formulate.config.js file #1

andyfensham opened this issue Apr 23, 2021 · 1 comment

Comments

@andyfensham
Copy link

Trying to add the plugin as per the vue-formulate documentation for nuxt.

Here is the doc ref where I got the syntax from : https://vueformulate.com/guide/installation/#nuxt

Please see my code below.

`import VueFormulateStarRating from 'vue-formulate-star-rating'

export default {
plugins: [VueFormulateStarRating],
classes: {
outer: 'mb-4',
input(context) {
switch (context.classification) {
case 'button':
return 'btn'
default:
return 'border border-gray-400 rounded px-3 py-2 leading-none focus:border-green-500 outline-none border-box w-full mb-1'
}
},
label: 'font-medium text-sm',
help: 'text-xs mb-1 text-gray-600',
error: 'text-red-700 text-xs mb-1',
},
}`

Setting it up like this I get a "document is not defined", although without the plugin my furmulate.config.js works perfectly

@chris-jamieson
Copy link
Owner

Hi Andy, thanks for the issue.

I'm not too familiar with Nuxt.js but I see there are some standard workarounds for the "document is not defined" error as discussed on this Stack Overflow post.

There is some discussion of SSR with Nuxt on the issues list for vue-star-rating - please see suggested fixes here for example: craigh411/vue-star-rating#17

The vue-star-rating project has an open issue for adding SSR support: craigh411/vue-star-rating#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants