Created
September 25, 2021 19:57
-
-
Save stuart-haas/347988750e561a2a01c7afb303db5304 to your computer and use it in GitHub Desktop.
Nuxt modal plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (context, inject) => { | |
const dialog = { | |
open: (options) => { | |
window.$nuxt.$emit('dialog', { ...options, open: true }); | |
}, | |
close: (options) => { | |
window.$nuxt.$emit('dialog', { ...options, open: false }); | |
} | |
}; | |
inject('dialog', dialog); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment