1 year ago
#377016

s4eed
Quasar object is not defined inside a vuex action function
According to this page, I can import Quasar
object like this outside of a vue
file:
import { Quasar } from 'quasar'
console.log(Quasar.platform.is.ios)
I have this vuex action function:
import { Quasar } from 'quasar'
import { getServiceProviderSpec, isPageRegistered } from '../../services/ContentProviderService'
export function updateContentProvider(context) {
console.log(Quasar.platform.is.ios)
if (Quasar.platform.is.bex) {
Quasar.bex.send('bex.get.url').then(url => {
const spec = getServiceProviderSpec(url.data)
isPageRegistered(spec.domain, spec.page).then(resp => {
spec.isRegistered = resp.status === 200
context.commit('setContentProvider', spec)
})
}).catch(e => console.log(e))
} else {
// just for test
context.commit('setCurrentUrl', 'https://instagram.com/s4eed')
}
}
What this function does, is not important, but I can't access Quasar
object here, it's undefined. Actually I have a Button in my vue file, and when clicks I call this action.
quasar-framework
0 Answers
Your Answer