onchange
Description
Fires when a new tab is selected in the controlUsage
onchange?: (ev: { value: string | number }) => void;
Parameters
- value - (required) the id of the newly selected tab
Example
<script setup>
function handleChange(ev) {
active = ev.value;
console.log(active);
// => 2
}
</script>
<template>
<Tabs :options="tabs" :value="0" :onchange="handleChange" />
</template>
Details
The handler function returns the id of a newly selected tab.
Related article: Catching the change of the selected tab
Related sample: Tabs