@click with parameter from handlebar

Is there a way to send a parameter into a @click function taken from the handlebar syntax. I’m exhausting all options just trying to open an external link in a browser.

{{#each sites}}
<li>
  <a href="#" class="item-link item-content" @click="external({{url}})">
    <div class="item-media"><img src="{{icon}}" width="44px"></div>
    <div class="item-inner">
      <div class="item-title-row">
        <div class="item-title">{{name}}</div>
      </div>
      <div class="item-subtitle">{{urldisplay}}</div>
    </div>
  </a>
</li>
{{/each}}
1 Like

It will work if:

  • you have external method in your component methods
  • you need to wrap it with quotes like @click="external('{{url}}')"
3 Likes

Ahh. That was it, I overlooked the quotes!

1 Like