Q11. How do you register directives locally?
You can also register directives locally(apart from globally) using directives option in component as below, ```javascript directives: { focus: { // directive definition ...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (23 available).
You can also register directives locally(apart from globally) using directives option in component as below, ```javascript directives: { focus: { // directive definition ...
A directive object can provide several hook functions, 1. bind: This occurs once the directive is attached to the element. 2. inserted: This hook occurs once the element ...
All the hooks have `el`, `binding`, and `vnode` as arguments. Along with that, **update** and **componentUpdated** hooks expose `oldVnode`, to differentiate between the o...
A directive can take any valid javascript expression. So if you want to pass multiple values then you can pass in a JavaScript object literal. Let's pass object literal t...
In few cases, you may want the same behavior on `bind` and `update` hooks irrespective of other hooks. In this situation you can use function shorthand, ```javascript Vue...
If you want to render `a lot of static content` then you need to make sure it only evaluated once and then cached thereafter. In this case, you can use `v-once` directive...
You can still use model directive using two-way computed property with a setter. ```javascript computed: { username: { get () { return this.$store.state.user.username }, ...
In Vue 2.6 version, the new slot syntax is provided using v-slot directive which aligns syntax with Vue 3.0. This is going to be replacement for old slot syntax. The comp...
In Vue 2.6 release onwards, Directive arguments can now accept dynamic JavaScript expressions. i.e, the specific argument that we want to use is only known at runtime. Le...
Apart from the benefits of dynamic directives arguments, it brings two drawbacks or considerations on the usage 1. **Constraints on expressions:** When you perform comple...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.