Methods
Bu sahifa hali tarjima qilinmagan

Tarjima qoshish uchun havola boyicha o'tib Pull Request oching (havolaga o'tish).

Standart til uchun tarkibni ko'rsatadi.

import { createComponent } from "effector-vue";
since

createComponent introduced in effector-vue 20.3.0

Creates a Vue 2 component with the given stores bound to it. The stores are typed in this, which helps with TypeScript.

Methods

createComponent(options, store?)

Arguments

  1. options (Object): component options (hooks, methods, computed properties)
  2. store (Object): object of stores, passed to the component as its effector option

Returns

(vue component)

Example

<template> {{ $counter }} </template>
component.vue
import { createStore, createApi } from "effector";
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 },
);
Tarjima jamiyat tomonidan qollanilyapti

Ingliz tilidagi hujjatlar eng dolzarb hisoblanadi, chunki u effector guruhi tomonidan yozilgan va yangilanadi. Hujjatlarni boshqa tillarga tarjima qilish jamiyat tomonidan kuch va istaklar mavjud bo'lganda amalga oshiriladi.

Esda tutingki, tarjima qilingan maqolalar yangilanmasligi mumkin, shuning uchun eng aniq va dolzarb ma'lumot uchun hujjatlarning asl inglizcha versiyasidan foydalanishni tavsiya etamiz.

Hammualliflar