No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Solved] How can we test $q.platform on boot files?

    Help
    1
    2
    397
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      realtebo last edited by realtebo

      I’m initializing a db using a cordova plugin.

      I’d like in the boot to detect if app is running on mobile, before even try to open db.

      I tried the following

      export default async ({ Vue }) => {
        if (!Vue.$q.platform.is.mobile) {
          return
        }
      ...
      

      But Vue.$q is undefined here

      1 Reply Last reply Reply Quote 0
      • R
        realtebo last edited by

        Solved… read the doc. …

        // import something here
        import { Platform } from 'quasar'
        
        export default async (/* { Vue } */) => {
          if (!Platform.is.mobile) {
            return
          }
        
        1 Reply Last reply Reply Quote 2
        • First post
          Last post