-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Closed
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
<script setup>
const { locale, t } = useI18n();
const items = [
{
title: 'change language',
props: {
onClick: () => (locale.value = locale.value === 'zh-CN' ? 'en-US' : 'zh-CN'),
},
disabled: true,
},
]
const onClick = (e, item) => {
if (item.disabled) return;
item.onClick?.(e);
if (item.children) {
toggleExpand(item);
}
};
</script>
<template>
<div
v-for="(item, i) in items"
:key="i"
v-bind="item.props"
v-on:click="(e) => onClick(e, item)"
>
</div>
</template>What is expected?
The item's onclick should be blocked from being triggered because it's disabled.
What is actually happening?
item.onclick is still triggered.
System Info
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels