Welcome to VueJs mastering the API, today we will talk about the optionMergeStrategies method.
It provides us a powerful way to create plugins to intercept and modify the default behavior of Vue hook life cycle.
None of the official documentationhelps me to learn how to use it, So after some research finally learn a path.
Create the file:
Now to install the plugin add the code to your
Once installed our customMethod will be available in any component
The customMethod executes him code right before the default createdMethod code, so if you need to run something before the default hooks code just replace the line 8 to another hookMethod from
customMethod.js or overwrite another hookMethod.
If I help you please consider helping me too. Leave comments, share it. Believe me, your feedback it's really important to me.