Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

san-mixin

0.2.2 • Public • Published

SAN MIXIN

Installation

npm i san-mixin

Usage

import mixin from 'san-mixin'
 
const Component = san.defineComponent({
    initData() {
        return {
            foo: 1
        }
    },
    getBar() {
        console.log(this.data.get('bar'))
    }
})
 
mixin(Component, {
    initData() {
        return {
            bar: 2
        }
    },
    getFoo() {
        console.log(this.data.get('foo'))
    }
})
 
const instance = new Component()
 
console.log(instance.getFoo()) // 1
console.log(instance.getBar()) // 2

Keywords

Install

npm i san-mixin

DownloadsWeekly Downloads

2

Version

0.2.2

License

MIT

Unpacked Size

12 kB

Total Files

8

Last publish

Collaborators

  • avatar