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

    Cookies get method doesn'T work

    Help
    2
    2
    401
    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.
    • M
      mecjos last edited by

      Hi I’m new on quasar. I want to use Cookies plugins. I’m trying to use it a follows :

      import { Cookies } from 'quasar'
      
      const TokenKey = 'userToken'
      
      export function getToken () {
        return Cookies.get(TokenKey)
      }
      export function setToken (token) {
        return Cookies.set(TokenKey, token)
      }
      export function removeToken() {
        return Cookies.remove(TokenKey)
      }
      

      and my quasar.js file is as follows ;

      import { Quasar, Cookies } from 'quasar'
      
      Vue.use(Quasar, {
        config: {},
        components: { /* not needed if importStrategy is not 'manual' */ },
        directives: { /* not needed if importStrategy is not 'manual' */ },
        plugins: {
          Cookies
        }
       })
      

      I got following error… What’s the problem I don’t understand…

      “quasar_src_plugins_Cookies_js__WEBPACK_IMPORTED_MODULE_0__.default.get is not a function”

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

        So, your intention is to use Quasar as a Vue CLI plugin? This bottom code makes no sense to me.

        Scott

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