title: If statement inside Vue click to change function to be run?
body: <p>How can I use an if statement inside either a v-bind, v-on or @ click to handle which function gets run?</p>
  
  <p>What I have right now that only sort of works is this (the if statement is in shorthand javascript): </p>
  
  <pre><code>        &lt;li v-for="entry in entries.entries"&gt;&lt;button type="button" @click="entry.entries?openSub($event):'entry.action'"&gt;{{entry.title}}&lt;/button&gt;
  </code></pre>
  
  <p>So basically, if the buttons list item has sub entries inside it the button should trigger the function that adds the submenu-active class to the list item, and if the list item the button is in does not have any sub entries it should run whatever function has been assigned to the button.</p>
  
  <p>I say it sort of works because it does run the openSub($event) part correctly, but it neither runs nor even adds the function that's supposed to be run if there are no entries.</p>