1.

Explain Vue.js common issues when tracking changes?

Answer»

The most common lifecycle hooks are mounted, UPDATED, and unmounted. All lifecycle hooks are called with their ‘this’ context pointing to the current active INSTANCE invoking it. 

Arrow functions are not independent, and as a result, they cannot DEFINE a ‘this’ of their own. But arrow functions are bound to their parent’s function’s context. 

The Arrow function (=>), when used in the Vue app, the Arrow function (=>), the keyword ‘this’ does not bind to the Vue instance, resulting in errors. 

HENCE it is advised to use the standard function declaration instead of the arrow function, as shown below. 

export default {  mounted() {  console.log(`the component is now mounted.`) } }


Discussion

No Comment Found

Related InterviewSolutions