Upgrade toQuasar v2and use Vue.js 3
Popup Edit

The QPopupEdit component can be used to edit a value “in place”, like for example a cell in QTable. By default, a cell is displayed as a String, then if you are using QPopupEdit and a user clicks/taps on the table cell, a popup will open where the user will be able to edit the value using a textfield.

This component injects a QMenu into its parent DOM element and enables the behavior described above, so it can be used anywhere, not only in QTable.

QPopupEdit API



If used on a QTable, QPopupEdit won’t work with cell scoped slots.


With QTable

Click on the cells to see the popup editor. The column “Name” demonstrates the title prop. The column “Calories” displays a numeric value usage. The column “Fat” also demonstrates the disable prop. If you look at the source code, you’ll see the cell for “fat” is using QPopupEdit, yet when clicking on the cell, the popup doesn’t show.


There is also a title slot, which you can use to inject your own title, as demonstrated in the “Calcium” column.


Persistent and with buttons

You can also add two buttons with the buttons prop, “Cancel” and “Set” (the default labels). These buttons help to control the user’s input. Along with the buttons prop, you also have the persistent prop, which denies the user from closing the popup with the escape key or clicking/ tapping outside of the popup. The persistent prop is demonstrated in the “carbs” column. Lastly, you can control the labels of the two buttons with the label-set and label-cancel props, as seen in the “Protein” column. Notice “Save” is replacing “Set” and “Close” is replacing “Cancel”.

The default scoped slot

The default slot’s parameters are:

{ initialValue, value, validate, set, cancel, updatePosition, emitValue }


Do not destructure the slot’s parameters as it will generate linting errors when using the value prop directly with v-model.

Textarea / QEditor

Since QPopupEdit wraps QInput, you can basically use any type of QInput. For instance, you can also use a text area as shown below in the “Comments” column.


When using a multi-line control (textarea, QEditor) for input, you’ll need to also use @keyup.enter.stop on the component in order to stop the enter key from closing the popup. You’ll also need to add buttons for controlling the popup too.


QPopupEdit also allows for simple validation of the input. To use it, you give it a callback function in the form of an arrow function and it should return a Boolean. (value) => Boolean. This is demonstrated in the “Calories” column below.

Tip 1

Notice we are using the hide event to also revalidate the input. If we don’t, QInput’s error prop will ‘hang’ in an invalid state.

Tip 2

With this example, we are using QInput’s external error handling. We could also use QInput’s validation prop and emit the value to QPopupEdit’s validation prop. The same concept can be implemented, when using Vuelidate too. In other words, the value given to QPopupEdit’s validate function can come from anywhere.