sweet-modal-vue
sweet-modal-vue copied to clipboard
Doese work with Nuxt
I spent whole last night trying to use it with Nuxt. It just wouldn't work.
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 }
...
],
Thanks
On 2 Mar 2018 15:03, "Mark Combalicer" [email protected] 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 .
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 } ... ],
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>
This issue needs attention :)