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

v-gallery vuepress #8

Open
shriaviator opened this issue Jan 21, 2021 · 4 comments
Open

v-gallery vuepress #8

shriaviator opened this issue Jan 21, 2021 · 4 comments

Comments

@shriaviator
Copy link

using v-gallery in vue press

v-gallery works satis during dev
Below error during build

ReferenceError: document is not defined at n (node_modules/v-gallery/dist/v-gallery.js:1:2026) at o (node_modules/v-gallery/dist/v-gallery.js:1:1856) at t.exports (node_modules/v-gallery/dist/v-gallery.js:1:3540) at Object.<anonymous> (node_modules/v-gallery/dist/v-gallery.js:1:14711) at e (node_modules/v-gallery/dist/v-gallery.js:1:348) at Object.<anonymous> (node_modules/v-gallery/dist/v-gallery.js:1:3903) at e (node_modules/v-gallery/dist/v-gallery.js:1:348) at Object.<anonymous> (node_modules/v-gallery/dist/v-gallery.js:1:11594) at e (node_modules/v-gallery/dist/v-gallery.js:1:348) at Object.<anonymous> (node_modules/v-gallery/dist/v-gallery.js:1:11471) at e (node_modules/v-gallery/dist/v-gallery.js:1:348) at server-bundle.js:6537:566

  • any suggestions ? , it works on the v-gallery documentation site using vuepres

Request

if you could point to the original docs for the v-gallery documentation site on git hub that would be highly helpful

@TerryZ
Copy link
Owner

TerryZ commented Jan 22, 2021

You can try dynamically import

https://vuepress.vuejs.org/guide/using-vue.html

vuejs/vuepress#442

@shriaviator
Copy link
Author

shriaviator commented Jan 22, 2021

  • Can u point to the repository for the v-gallery documentation { orginal repo} to c how it is implemented & learn , I want to also use the other plugins created by U via the same method in vuepress

@TerryZ
Copy link
Owner

TerryZ commented Jan 22, 2021

.vuepress/enhanceApp.js file for example

import Gallery from 'v-gallery'

export default ({
  Vue,
  options,
  router,
  siteData
}) => {
  if (typeof process === 'undefined') {
    Vue.use(Gallery)
  }
}

or

export default ({
  Vue,
  options,
  router,
  siteData
}) => {
  import('v-gallery').then(resp => {
    Vue.use(resp.default)
  })
}

More references: https://vuepress-examples.netlify.app/demos/plugins/

@shriaviator
Copy link
Author

shriaviator commented Jan 22, 2021

  • Gr8 , Clarifies everything , Appreciate the prompt response . Thanks :)

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