Closed maggie44 closed 2 years ago
Hi @maggie0002! 👋
It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.
Without a proper reproduction, your issue will have to get closed.
Thank you for your collaboration. 👏
I think this is expected as quasar prefixes __q_strn
to keep track of original value type. You can try to use $q.localStorage.get('lang')
and it should give you test
.
It wasn't changing even when I used the .getItem(). Turns out though, I had missed the $q:
Returned a string, but included the prefix:
localStorage.get('lang')
Returned the correct string:
$q.localStorage.get('lang')
The missing $q was just a typo, but as it didn't error I missed it.
What happened?
When creating a local storage item, the value set is prefixed with
__q_strn
. For example:$q.localStorage.set('lang', 'test');
Outputs:
__q_strn|test
Maybe related to: https://github.com/quasarframework/quasar/issues/1199
What did you expect to happen?
Output should be:
test
Reproduction URL
I have been unable to replicate local storage behaviour on jsFiddle
How to reproduce?
Create a new Quasar project (I used Typescript).
Add the localstorage plugin to the quasar.conf.js file, then run the code:
Check the local storage in your browser
Flavour
Quasar CLI (@quasar/cli | @quasar/app)
Areas
Components (quasar)
Platforms/Browsers
Firefox, Safari
Quasar info output
Relevant log output
No response
Additional context
No response