Skip to content
This repository was archived by the owner on Jun 30, 2018. It is now read-only.

Latest commit

 

History

History
45 lines (33 loc) · 713 Bytes

README.md

File metadata and controls

45 lines (33 loc) · 713 Bytes

Vue Relation

A set of Vue.js mixins for modelling relations between components

Contents

Installation

$ yarn add vue-relation

Usage

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)
  }
}

License

Copyright © 2017 Kasper Kronborg Isager. Licensed under the terms of the MIT license.