Explain the difference between v-if and v-show directives in vue.js?
S.no | V-if | V-show |
---|---|---|
1. | It is used for UI element rendering. | V-show is used to manage the display of a UI element. |
2. | V-if has else part | Doesn’t support “no else” part. |
3. | Only renders the elements that fulfill the condition. | It renders all elements and optimally manages with CSS “display” attribute. |
BY Best Interview Question ON 08 Jun 2019