Vue
Plugin
import { createOvermind } from 'overmind'
import { createPlugin } from 'overmind-vue'
const overmind = createOvermind({
state: {
foo: 'bar'
},
actions: {
onClick() {}
}
})
export const OvermindPlugin = createPlugin(overmind)import Vue from 'vue/dist/vue'
import { OvermindPlugin } from './overmind'
Vue.use(OvermindPlugin)
...<template>
<div @click="actions.onClick">
{{ state.foo }}
</div>
</template>import Vue from 'vue/dist/vue'
import { OvermindPlugin } from './overmind'
Vue.use(OvermindPlugin, ({ state, actions, effects }) => ({
admin: state.admin,
posts: state.posts,
actions,
effects
}))
...<template>
<div @click="actions.onClick">
{{ admin.foo }} {{ posts.foo }}
</div>
</template>Rendering
Pass state as props
Reactions
Connect
Computed
Using props
Last updated