Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (34 sloc) 791 Bytes
id title
create-component
createComponent

createComponent(componentOptions, store?)

Arguments

  1. componentOptions (Object): component options ( hooks, methods, computed properties )
  2. store (Object): Store object from effector

Returns

(vue component)

Example

<template>
  {{ $counter }}
</template>
// component.vue
import { createComponent } from 'effector-vue'

const $counter = createStore(0);
const { update } = createApi($counter, {
  update: (_, value: number) => value,
})

export default createComponent({
  name: "Counter",

  methods: {
    update,
    handleClick() {
      const value = this.$counter + 1; // this.$counter <- number ( typescript tips )
      this.update(value);
    }
  },
}, { $counter })
You can’t perform that action at this time.