3

I'm creating a table with bootstrap, one of the field is a link and should be opened in a new tab using target="_blank"

However, for some reason it doesn't work, any idea why ?

Thanks.

Full code :

<b-table striped hover
  :items="applications"
  :filter="filter"
  :fields="fields"
  :bordered="true"
  :small="true"
  @filtered="onFiltered"
  >
  <template slot="lien" slot-scope="fields">
    <a :href="fields.value" :target="_blank">
    {{fields.value}}
    </a>
  </template>
</b-table>

EDIT :

Fixed with unbinding the target attribute thanks to Jom

Working code :

<b-table striped hover
  :items="applications"
  :filter="filter"
  :fields="fields"
  :bordered="true"
  :small="true"
  @filtered="onFiltered"
  >
  <template slot="lien" slot-scope="fields">
    <a :href="fields.value" target="_blank">
    {{fields.value}}
    </a>
  </template>
</b-table>
2
  • 6
    No need to bind the target attribute here. Simply target="_blank" should work. Commented Jan 21, 2019 at 9:11
  • 3
    @jom Jom, it works great now. Monday mornings you know ... Thanks a lot ! Commented Jan 21, 2019 at 9:27

1 Answer 1

4

I think you dont need to bind the target value as _blank is not a model

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.