omi/packages/omiv
dntzhang c3624695c5 publish: omiv v0.1.1, remove react from dependencies 2019-10-02 18:30:21 +08:00
..
config refactor: split omiv from omis 2019-10-02 18:17:43 +08:00
dist publish: omiv v0.1.0 2019-10-02 18:23:52 +08:00
src publish: omiv v0.1.0 2019-10-02 18:23:52 +08:00
README.md refactor: split omiv from omis 2019-10-02 18:17:43 +08:00
package.json publish: omiv v0.1.1, remove react from dependencies 2019-10-02 18:30:21 +08:00

README.md

Omiv

Observable store system for Vue apps.

Usage

import { $v } from 'omiv'
import App from './App.vue'

$v.render(App, '#app', new class {
  data = {
    count: 1
  }
  sub = () => {
    this.data.count--
  }
  add = () => {
    this.data.count++
  }
})

HelloWrold.vue:

<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <button @click="store.sub">-</button><span>{{state.count}}</span><button @click="store.add">+</button>
  </div>
</template>

<script>
import {$v} from 'omiv'
export default $v({
  name: 'HelloWorld',
  props: {
    msg: String
  },
  //or use: ['count']
  useSelf: ['count']
})
</script>