Skip to main content

change

type ChangeEvent {
detail:{
// changed item
item: {
id: string;
comp: any;
};
// new value of item
value: any;
}
}

onChange(ev: ChangeEvent):void

event occurs when the value of a control in the toolbar changes and can be used to handle changes in toolbar controls

Usage

Handling control value change

<script>
const items = [
{ id: "name", comp: Text },
{ id: "email", comp: Text },
];
function handler(ev) {
const { item, value } = ev.detail;
console.log("changed control", item.id);
console.log("new value", value);
}
</script>

<Toolbar {items} on:change={handler} />