Skip to content

Instantly share code, notes, and snippets.

@m0jimo
Last active August 22, 2019 06:43
Show Gist options
  • Save m0jimo/e9a01aba076492c953174309f75e3428 to your computer and use it in GitHub Desktop.
Save m0jimo/e9a01aba076492c953174309f75e3428 to your computer and use it in GitHub Desktop.
Quasar FAQ

Here is a list of questions which are asked more often then others. If you know of a question that a lot of people ask, just ask it in a comment. If you would like to add to this faq, just leave a comment in the Q & A & R (question, answer, reference) format. Use Markdown! Let's Answer this!!!

Quasar framework FAQ

Although Quasar framework documentation covers most of the asked questions from users I think it would be nice to have quick reference guide to Frequently Asked Questions.

How to get a quick answer to my question?

If you like saving time to yourself and/or to Quasar users reacting to your answer please provide if possible:

  • Operating system, Browser (version), Quasar version quasar --version
  • link to jsFiddle or Codepen - you can create your own example in Codepen from the existing Quasar component examples e.g. Docs - Quasar - Tabs

Before proceeding following steps have your tried Google your question?

  1. check the FAQ bellow
  2. search in Quasar docs page (See code examples e.g. Docs - Chat - Basic)
  3. check out Quasar forum
  4. join Discord chat server

R: Docs - Quasar - Awesome ever-growing community

CLI

Q: quasar dev or quasar serve results in Unknown command

A: When developing on Windows there can problems with NPM used locally. Delete node_modules, lock file and re-install yarn install --force with yarn. Or give a npm second chance npm install. General rule: User NPM for global packages, Yarn for local packages.

R: TODO - where is the information for new users that when developing under Windows is better to use Yarn (reasons)? Docs - Upgrade guide

Q: quasar build on Win 10 - complains about resource busy or locked. Windows restart is needed whenever I build the app.

A: There is probably other process blocking the dist/spa folder (e.g. Tortoise Git, Remote Desktop etc.). Install a Process Monitor to discover the process which blocks the folder.

Q: quasar upgrade, quasar serve Command not found

A: Try to change configuration path of Terminal in your code IDE. Docs - cli - upgrade

WebStorm Location

Go to: Settings | Tools | Terminal and Add 'node_modules/.bin' from the project root to $PATH

R: StackOverflow - terminal shows old npm version Note: it is not working anymore (WebStorm 2019.2)

Q: Failed to compile with ... - application is not compiled and stops - regex expression.

A: There are some cases when the regex is not parsed by Babel. Try to change the regex.

Regex example

const regex = /(?<=\[start])(.*)(?=\[end])/s; const result = src.match(regex);)

R: Babel - Issue #6246

Components

Q: I can't find component QAutocomplete

A: Autocomplete component does not exist anymore in Quasar v1. Functionality for autocompleting is part of QSelect component

R: Docs - QSelect

Q: QTable - I'd like to get the current data table sort status

A: Use custom sort function or undocumented property this.$refs.YourTableName.computedData.rows

R: Docs - QTable, Example - JsFiddle, Discord chat - @Tobias Mesquita (PT-EN) - 11.04.2019

Q: How do I get QSelect to display the label instead of the value?

A: Often you might wish to display the label value of your options in the QSelect rather than the actual value. For example, if you have a QSelect for SalesRegionId but wish to show the descriptive label of that region. eg. Label: NorthWestSales Value: 3

To get this to work in that way, you need to add two settings to your QSelect: emit-value map-options

R: Docs - QSelect, Example - Codepen

UDM

Q: My code in jsFiddle or Codepen doesn't work

More examples

QTab - tabs looks like they were nested
Browser terminal contains errors

A: Be sure you are not using self closing tags.

R: Docs - UMD - Usage

IE11

Q: Can I use jsFiddle or Codepen for IE11 issues?

A: Unfortunately those services are not supporting IE11 (to date 2019-07-10).
But you can use Codesandbox and published link works on IE11. Source needs to be edited in other modern browser.

IDE

Q: WebStorm - how to configure Run/Debug to start debugging application?

A: Add Node.js to configuration with following paths:

Node interpreter: Project C:\Program Files\nodejs\node.exe
Working directory: D:\path\myApp
JavaScrip file: ~\AppData\Roaming\npm\node_modules\@quasar\cli\bin\quasar
Application parameters: dev
URL: http://localhost:8080

Q: WebStorm (2019.1) - autocomplete doesn't work for Quasar components

A: Check out the article Hack WebStorm to Introspect Quasar Framework Components or go directly to Plugin - Quasar Ide Helper

Note: Webstorm 2019.2 has autocomplete implemented but get more details

@realtimeappsolutions
Copy link

Q: How do I get QSelect to display the label instead of the value?

A: Often you might wish to display the label value of your options in the QSelect rather than the actual value. For example, if you have a QSelect for SalesRegionId but wish to show the descriptive label of that region. eg. Label: NorthWestSales Value: 3

To get this to work in that way, you need to add two settings to your QSelect

emit-value
map-options

R: Docs: https://quasar.dev/vue-components/select#Example--Map-options
Example Codepen: https://codepen.io/david-watson-the-encoder/pen/eqNrZz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment