Skip to main content

api.on()

Description

Allows attaching a handler to the inner events

Usage

api.on(
event: string,
handler: function
): void;

Parameters

  • event - (required) an event to be fired
  • handler - (required) a handler to be attached (the handler arguments will depend on the event to be fired)

Example

<script setup>
import { getData } from "./common/data";
import { FilterBuilder } from "@svar-ui/vue-filter";

const { value, fields, options } = getData();

const init = (api) => {
api.on("edit-rule", ({ id }) => {
console.log(id);
});
}
</script>

<template>
<FilterBuilder :data="data" :fields="fields" :options="options" :init="init" />
</template>

Related articles: How to access FilterBuilder API