api.on()
Description
Allows attaching a handler to the inner eventsUsage
api.on(
event: string,
handler: function
): void;
Parameters
event
- (required) an event to be firedhandler
- (required) a handler to be attached (the handler arguments will depend on the event to be fired)
Example
<script>
import { getData } from "./common/data";
import { FilterBuilder } from "wx-svelte-filter";
const { value, fields, options } = getData();
const init = (api) => {
api.on("edit-rule", ({ id }) => {
console.log(id);
});
}
</script>
<FilterBuilder {data} {fields} {options} {init} />
Related articles: How to access FilterBuilder API