Is there a way to incorporate an if statement within v-bind, v-on, or @click in order to determine which function should be executed?
The current approach that I have, though partially effective, is as follows (using shorthand JavaScript for the if statement):
<li v-for="entry in entries.entries"><button type="button" @click="entry.entries?openSub($event):'entry.action'">{{entry.title}}</button>
Essentially, if the button's list item contains sub entries, clicking the button should activate the function that adds the submenu-active class. If there are no sub entries present, the button should execute the assigned function instead.
While the openSub($event) function runs correctly, the function designated for situations with no entries neither executes nor gets added to the button.