Why we need Vue.js mixins?

devquora
devquora

Posted On: Feb 22, 2018

 

Mixins in Vue JS are a chunk of defined logic that is stored in a particular way. It can be re-used over and over to add functionality to your Vue instances and components. It is important that we need Vue JS because,

  1. You can easily adhere to the DRY principle with mixins. It ensures that you do not repeat yourself.
  2. You get a lot of flexibility with mixins. Mixin contains options for Vue components.
  3. Mixins are safe and they do not affect changes outside their defined scope.
  4. Mixins in Vue JS are a great platform for code reusability.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Vue.js Interview Questions

    What is Vue.js?

    Vue js is progressive javascript script used to create dynamic user interfaces.Vue js is very easy to learn.In order to..

    Vue.js Interview Questions

    List some features of Vue.js.

    Vue js comes with following features Templates Reactivity Components Transitions Routing ..

    Vue.js Interview Questions

    Explain Life cycle of Vue Instance.

    The Life cycle of each Vue instance goes through a series of initialization steps when it is created. – for example, ..