onMounted(() => {
setTimeout(() => {
const toggleObj = ToggleComponent.getInstance(
toggleRef.value!
) as ToggleComponent | null;
if (toggleObj === null) {
return;
}
// Add a class to prevent sidebar hover effect after toggle click
toggleObj.on("kt.toggle.change", function () {
// Set animation state
props.sidebarRef?.classList.add("animating");
// Wait till animation finishes
setTimeout(function () {
// Remove animation state
props.sidebarRef?.classList.remove("animating");
}, 300);
});
}, 1);
});