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

Nuxt Support #25

Closed
Mailines opened this issue Jul 29, 2020 · 4 comments
Closed

Nuxt Support #25

Mailines opened this issue Jul 29, 2020 · 4 comments

Comments

@Mailines
Copy link

Hi,
I like this library alot, nice work but:
I use it with Nuxt and registered the component global as a plugin. With the DEV-Server everything works fine, but when I compile the application the upload-icon is not displayed and the element is not longer centered.
What do I have to change?

On DEV-Server
image

In Production:
image

// ./plugins/v-image-input.js

import Vue from 'vue'
import VImageInput from 'vuetify-image-input'

Vue.component(VImageInput.name, VImageInput)
```

@Mailines
Copy link
Author

Nevermind, using the a la carte treeshaking in the scope of the component fixed the issue. 👍 💯
Maybe you can add this solution for NUXT to the docs.

@geocare
Copy link

geocare commented Dec 26, 2020

@Mailines can you show me how to do it?

@Mailines
Copy link
Author

Mailines commented Feb 1, 2021

@geocare
Sorry for the late reply.
I have implemented it this way:

<template>
   <no-ssr>
      <v-image-input
         v-model="imageData"
         :image-quality="0.85"
         clearable
         :disabled="uploadImageLoading"
         />
   </no-ssr>
</template>

<script>
import VImageInput from 'vuetify-image-input/a-la-carte'

export default {
  ssr: false,
  components: {
    VImageInput
  }
}
</script>

In nuxt.config.js additionally add the library in the build block to transpile.

// nuxt.config.js
build: {
    transpile: ['vuetify/lib', 'vuetify-image-input']
  },

I hope this helps.

@geocare
Copy link

geocare commented Feb 2, 2021

Thanks! It worked! @Mailines

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