setting vModel value in mounted hook may cause confusion
Version
https://github.com/vuejs/vue-next/commit/54ed7592e416fc411196e9b767aebcc4f2ca20d8
Reproduction link
https://jsfiddle.net/uL8f9e2d/
Steps to reproduce
- open the terminal, see the log
What is expected?
custom directive's mounted hook should be called after value is set
What is actually happening?
custom directive's mounted hook is called before value is set because v-test is before v-model in template
Hmm, I'm not sure if it's something that needs to be "fixed" - in fact, this gives the custom directive the ability to do something in mounted before OR after v-model value is set, by adjusting the order of its position relative to v-model. This is the case with v-bind bindings too (which are now also order-sensitive in v3). "Fixing" this actually removes some capabilities.
We might need to explain this is big red letters in the docs though 😜
I hold the same idea, so the title is may cause confusion. maybe it should be a documentation work, or let Vue remind devs in development mode that these are order-sensitive in an appropriate way?
@ docs team: transferred as a placeholder that we should likely document this a a case where order of directives has an influence on behavior.