Vue.js Interview Questions | Eklavya Online

Vue.js Interview Questions

What is a single-file component in Vue.js?

In Vue.js, a single-file component is a file with a .vue extension that contains a Vue component. The single-file component consists of the component’s template, logic, and styles, all bundled together in one file. It also contains one block, optional and blocks, and possible additional custom blocks.

How to use a single-file component in Vue.js?

To use a single-file component in Vue.js, we have to set up Vue Loader for parsing the file (It is done automatically as a part of a webpack building pipeline). It also supports non-default languages such as Sass or HTML templating languages with pluggable pre-processors.

What is the difference between one-way data flow/ or one-way data binding and two-way data binding?

In one-way data binding or one-way data flow, the view (UI) part of the application does not update automatically. In this model, when the data Model is changed, you need to write some custom code to make it updated every time after the change. The v-bind directive is used for one-way data flow or binding …

What is the difference between one-way data flow/ or one-way data binding and two-way data binding? Read More »

What is $parent property in Vue.js?

In Vue.js, the $parent property is used to access the parent instance from a child. It is similar to the $root property. The $parent property provides direct access, but it makes the application hard to test and debug. In this property, it is very difficult to find out where the mutation comes from.

What do you understand by components props in Vue.js?

In Vue.js, every component instance has its own isolated scope. So, you cannot directly reference parent data in a child component’s template. Props are used to pass down data to the child components. Props are custom attributes. You can register on a component. When a value is passed to a prop attribute, it becomes a …

What do you understand by components props in Vue.js? Read More »