A set of Vue.js mixins for modelling relations between components
$ yarn add vue-relation
import {relation, hasOne, memberOf} from 'vue-relation';
const family = relation()
const parent = {
mixins: [
hasOne(family, 'child')
],
created () {
console.log(this.child)
}
}
const child = {
mixins: [
memberOf(family, 'parent')
],
created () {
console.log(this.parent)
}
}
Copyright © 2017 Kasper Kronborg Isager. Licensed under the terms of the MIT license.