Accessing VUEX Store inside a Dialog with custom Component
-
Quasar V1.05
Hello,
i am using the Dialog plugin with an custom Component to show the Dialog in different pages.export function showResultsDialog (parentRoot) {
return new Promise(function (resolve, reject) {
Dialog.create({
component: RlShowResultsDialog,
root: parentRoot
}).onOk(() => {
resolve(‘ok’)
}).onCancel(() => {
resolve(‘cancel’)
})
})
}This function is called inside a page like this:
showResultsDialog(this.$root)Everything seems to work, but inside the custom Component i can not access the VUEX Store because
this.$store is undefined.Where is my mistake ? Has any body solved this problem? Thank you!
-
I have the same problem. Can someone help?
-
@ReDeLe can you try to create your dialog inside a boot file, see if it works ie.
// boot/customdialog.js ... // your dialog impl export default ({Vue, app}) => { Vue.prototype.$cDialog = showResultsDialog(app) ...
Btw this guide https://quasar.dev/quasar-plugins/dialog#Invoking-custom-component
Is called inside a vue file, so i think it should be called with that signature.