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

    How import { Screen } from 'quasar' by using UMD

    Help
    2
    3
    178
    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.
    • S
      sanjee last edited by

      Im having difficulties with importing via UMD
      i try created but seems like not accurate
      const Screen = require(‘quasar’)
      but having error
      require is not defined

      kindly share how to archive it ?

      qyloxe 1 Reply Last reply Reply Quote 0
      • qyloxe
        qyloxe @sanjee last edited by qyloxe

        @sanjee
        In UMD you do not need to import anything:

        // global context:
        console.log(Quasar.plugins.Screen)
        
        ...
             created () {
               // inside components:
               console.log(this.$q.screen)
             },
        

        it is available as this.$q.screen inside components or as Quasar.plugins.Screen in global (window) context.

        more here:

        https://quasar.dev/start/umd#Quasar-Plugins

        1 Reply Last reply Reply Quote 0
        • S
          sanjee last edited by

          thats cool thank you for your reply @qyloxe

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