Bind The Attributes in VueJs (v-bind) Leave a comment

Let’s start with an example think about it we have link data (link: ‘https://google.com’) if you want to bind attribute like “href” you can not use

<a href = “{{ link }}”>

Because it will return wrong parsed data. The correct way to use attributes use with:

<a v-bind:href=”link”> Test Url </a>

v:bind allows you to passing html data.

There is also shortcode “@”. It’s possible to use @ instead “of v-bind:”. Example: @href=”link”

Leave a Reply

Your email address will not be published. Required fields are marked *