props-to-data is a MIT-licensed open source project, which help your Vue 2 components communicate effortlessly with each other via props without contaminating component data.
We are regulating components to follow law of demeter, which is most underrated but indeed one of the most important and integral part of clean code movement, which helps you to reach goal of better, cleaner architecture.
npm install props-to-data
- Import package.
import propsToData from 'props-to-data'
- Add following to mixins array.
mixins: [propsToData]
- Add following to your data object, within a component.
propsToData: {
<prop-entity-name>: <data-entity-name>
}