@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}}
  <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 class="item-subtitle">{{urldisplay}}</div>
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}}')"

Ahh. That was it, I overlooked the quotes!

1 Like