Subscribe on changes!

Add "expression" to vue 3 directives, same as vue 2

avatar
Jun 30th 2021

What problem does this feature solve?

I'm having issues converting a Vue 2 app to Vue 3, a lot of functionality that was in Vue 2 seems to be crippled or missing in Vue 3.

Previously I had a directive that monitored the validation state of a variable in the model, e.g. v-validate="some.model.path". Vue 2 would give me both the path to this variable as the expression, which allows me to have an identifier in order to store the "dirty" state of the validation, as well as the actual variable value. With Vue 3 expression is gone.

What does the proposed API look like?

Please modify the virtual DOM definition to be able to store the original directive expression, same as Vue 2.

avatar
Jun 30th 2021

This breaking change should be documented at https://v3.vuejs.org/guide/migration/custom-directives.html#overview. Could you check if there isn't an open issue already and open one on the vuejs/docs repo

avatar
Jun 30th 2021

I'm requesting it be added back, not listed as breaking. Maybe I'll just keep using Vue 2 forever.