MenuComponent
I'm use menu,I hope when the <a ></a> is clicked and before the menu is shown ,could add some menu-item
<a
class="btn btn-sm btn-light btn-active-light-primary"
data-kt-menu-trigger="click"
data-kt-menu-placement="bottom-end"
data-kt-menu-flip="top-end"
id="www"
>输出
<span class="svg-icon svg-icon-5 m-0">
<inline-svg
:src="getAssetPath("media/icons/duotune/arrows/arr072.svg")"
/>
</span>
</a>
<!--begin::Menu-->
<div
class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semobold fs-7 w-125px py-4"
data-kt-menu="true"
>
<template v-for="i in state.taskLogData">
<div class="menu-item px-3">
<button
@click="actions.handleLog(i)"
class="btn btn-outline-info">
{{ i.time }}
</button>
</div>
</template>
<!--begin::Menu item-->
<!--end::Menu item-->
</div>
<!--end::Menu--> Below is the javascript code in vue
but it now worked
const menu = MenuComponent.createInsance("#www")
if (!menu){
return
}
menu.on("kt.menu.dropdown.show", function() {
console.log("menu dropdown show event fired");
}); Replies (3)
Deleted comment
Deleted comment
Deleted comment
Deleted comment
Deleted comment
Hi,
Thank you for reaching out to us.
You need to add your id on the element with an attribute data-kt-menu="true", also by default we have a global initialization if you want to prevent a global initialization for this element you can remove attribute data-kt-menu="true" and keep your id only.
Regards,
Lauris Stepanovs,
Keenthemes Support Team