Below are buttons with router-links. However, I only want the calculator button to open a modal. When I execute the code provided, all buttons trigger the modal instead of just the calculator button.
Output:
https://i.sstatic.net/layQ1.png
Router-link Code:
<div class="container menu-title">
<div class="shortcuts-horizontal pt-2 pb-2">
<template v-for="(menuItem, j) in item.shortcuts" :key="j">
<div class="menu-item btn-margin">
<router-link
class="menu-link shortcut-btn"
active-class="active"
:to="menuItem.route || menuItem.modal"
data-bs-toggle="modal"
data-bs-target="#calculator"
>
<span v-if="menuItem.svgIcon" class="menu-icon svg-margin">
<span class="svg-icon svg-icon-4">
<inline-svg :src="menuItem.svgIcon" />
</span>
</span>
</router-link>
</div>
</template>
</div>
</div>
Modal Code:
<div class="modal fade" tabindex="-1" id="calculator">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
</div>
</div>
</div>
</div>
Menu.ts Code:
shortcuts: [
{
route: "/activities/add/",
svgIcon: "/media/icons/duotune/art/art002.svg",
fontIcon: "bi-app-indicator",
},
{
route: "/quotes/add/",
svgIcon: "/media/icons/duotune/finance/fin010.svg",
fontIcon: "bi-app-indicator",
},
{
route: "/price-analysis/add/",
svgIcon: "/media/icons/duotune/graphs/gra004.svg",
fontIcon: "bi-app-indicator",
},
{
route: "/projects/add/",
svgIcon: "/media/icons/duotune/abstract/abs027.svg",
fontIcon: "bi-app-indicator",
},
{
modal: "#calculator",
svgIcon: "/media/icons/duotune/finance/fin007.svg",
fontIcon: "bi-app-indicator",
},
],