delete-rule
Description
Fires when deleting a filtering ruleinfo
When the last rule in a group is deleted, the group is also removed.
Usage
"delete-rule": ({
id: string | number;
}) => void;
Parameters
The callback of the action takes an object with the following parameters:
id
- the id of a deleted rule
Example
<script>
import { getData } from "./common/data";
import { FilterBuilder } from "wx-svelte-filter";
const { value, fields, options } = getData();
const init = (api) => {
api.on("delete-rule", ev => {
console.log("The id of the rule that was deleted:" (ev.id));
});
}
</script>
<FilterBuilder {value} {options} {fields} {init} />
Related articles: