visma-meglerfront / sweet-modal-vue

The sweetest library to happen to modals.
Other
755 stars 85 forks source link

Doese work with Nuxt #60

Open husayt opened 6 years ago

husayt commented 6 years ago

I spent whole last night trying to use it with Nuxt. It just wouldn't work.

mcombalicer commented 6 years ago

This worked for me

plugins/sweet-modal.js import Vue from 'vue' import SweetModal from 'sweet-modal-vue/src/plugin.js' Vue.use(SweetModal)

"/src" is missing on Install Globally doc.

nuxt.config.js modules: [ { src: '~plugins/sweet-modal', ssr: false } ... ],

husayt commented 6 years ago

Thanks

On 2 Mar 2018 15:03, "Mark Combalicer" notifications@github.com wrote:

This worked for me

plugins/sweet-modal.js import Vue from 'vue' import SweetModal from 'sweet-modal-vue/src/plugin.js' Vue.use(SweetModal)

"/src" is missing on Install Globally doc.

nuxt.config.js modules: [ { src: '~plugins/sweet-modal', ssr: false } ... ],

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adeptoas/sweet-modal-vue/issues/60#issuecomment-369944799, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHXrMwpObX_UzSDPIZly1oe9WjFUvLzks5taV9CgaJpZM4SX6yj .

gbikas commented 5 years ago

This worked for me

plugins/sweet-modal.js import Vue from 'vue' import SweetModal from 'sweet-modal-vue/src/plugin.js' Vue.use(SweetModal)

"/src" is missing on Install Globally doc.

nuxt.config.js modules: [ { src: '~plugins/sweet-modal', ssr: false } ... ],

Don't add sweet modal configuration in nuxt modules. Instead add it in plugins:

plugins: [ { src: '~plugins/sweet-modal', ssr: false } ... ],

jevets commented 5 years ago

I had to put <sweet-modal /> in a nuxt <no-ssr /> component to avoid virtual DOM issues.

(note for future ref)

<no-ssr>
  <sweet-modal>content</sweet-modal>
</no-ssr>
aprilahijriyan commented 3 years ago

This issue needs attention :)