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

    platform.is response is undefined with Vue CLI 3

    Help
    3
    5
    506
    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.
    • A
      anhln8x last edited by

      Hello,
      I use Vue CLI 3 plugin and platform.is in state.js file, but it response is undefined.

      export default {
      preferences: {
      platform: Platform.is, // this.$q.platform.is.desktop
      fullScreen: AppFullscreen.isActive // this.$q.fullscreen.isActive
      }
      }

      It will not fail when I use it in .vue file (this.$q.platform.is.desktop)

      export default {
          name: 'Home',
          data() {
              return {
                  leftDrawerOpen: this.$q.platform.is.desktop
              }
          },
          methods: {
              openURL
          }
      }
      

      I’m using:
      –Vue version 3.0.5
      –Quasar-framework version 0.17.17

      Similarly create a template with Quasar CLI everything is normal no errors.

      Please give me information to solve this problem. Thanks

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by s.molinari

        I don’t think Quasar globals will be available anywhere else other than in components within a Vue project.

        I don’t even understand why this version of Quasar is offered. It is a patch for a problem that I don’t know of and only causes confusion, when it is used. At least I don’t understand what problem the Quasar plugin is solving.

        Quasar IS Vue, so there is no reason to patch it/ plug it into Vue.

        Scott

        1 Reply Last reply Reply Quote 0
        • A
          anhln8x last edited by

          Hi Scott,

          I would like to mention a problem, when using Vue CLI 3 to build project with quasar framework. Can not retrieve this $ q.platform.is in .js files. Is there a difference between Quasar CLI and Vue CLI.

          Thanks

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Yes. Quasar CLI is built for Quasar. The Vue CLI is built for Vue. If you want all the features of Quasar, it’s best to use the Quasar CLI.

            Scott

            1 Reply Last reply Reply Quote 0
            • metalsadman
              metalsadman last edited by

              $q only work inside .vue files, if you like to use it then you’ll need to do an import in your .js file.
              ie:
              //somefile.js
              import { Platform } from ‘quasar’
              isMobile() {
              return Platform.is.mobile
              }

              https://quasar-framework.org/components/platform-detection.html

              1 Reply Last reply Reply Quote 0
              • First post
                Last post