DesignRevision / shards-vue

🌟Shards Vue is a free, beautiful and modern Vue.js UI kit based on Shards.
https://designrevision.com/docs/shards-vue/
MIT License
393 stars 40 forks source link

Does not work in nuxt.js universal mode. #23

Open yuta-hayashi opened 5 years ago

yuta-hayashi commented 5 years ago

Expected Behavior

I used shards-vue in universal mode of nuxt.js. The universal mode executes ssr.

Current Behavior

It did not work at all with the error document is not defined. But, it worked when I changed to spa mode.

Steps to Reproduce

  1. Set nuxt.js to universal mode.
  2. Set shardsVue to nuxt.js plugin.
  3. Use the shardsVue component on the page.

Context (Environment)

I cannot execute SSR or generate in nuxt.js.

Possible Solution

I think it probably contains functions that cannot be executed in SSR. So when I set the plugin mode in nuxt.config.js to client, it worked fine.

nuxt.config.js

  plugins: [{src:'~/plugins/shardsVue', mode: 'client'}
  ],

I think nuxt.js is one of the most popular frameworks and would you please add this to the documentation if you like?