Q21. Why should not use if and for directives together on the same element?
It is recommended not to use v-if on the same element as v-for. Because v-if directive has a higher priority than v-for. There are two cases where developers try to use t...
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 (251 available).
It is recommended not to use v-if on the same element as v-for. Because v-if directive has a higher priority than v-for. There are two cases where developers try to use t...
In order to track each node's identity, and thus reuse and reorder existing elements, you need to provide a unique `key` attribute for each item with in `v-for` iteration...
As the name suggests, mutation methods modifies the original array. Below are the list of array mutation methods which trigger view updates. 1. push() 2. pop() 3. shift()...
The methods which do not mutate the original array but always return a new array are called non-mutation methods. Below are the list of non-mutation methods, 1. filter() ...
Vue cannot detect changes for the array in the below two cases, 1. When you directly set an item with the index,For example, ```javascript vm.todos[indexOfTodo] = newTodo...
Vue cannot detect changes for the object in property addition or deletion. Lets take an example of user data changes, ```javascript var vm = new Vue({ data: { user: { nam...
You can also use integer type(say 'n') for `v-for` directive which repeats the element many times. ```javascript {{ n }} ``` It displays the number 1 to 20. ****
Just similar to v-if directive on template, you can also use a `` tag with v-for directive to render a block of multiple elements. Let's take a todo example, ```javascrip...
You can use event handlers in vue similar to plain javascript. The method calls also support the special $event variable. ```javascript Submit methods: { show: function (...
Normally, javascript provides `event.preventDefault() or event.stopPropagation()` inside event handlers. You can use methods provided by vue, but these methods are meant ...
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.