How do I dynamically add the value of the a tag rel attribute?

clipboard.png

<li><a rel="nofollow" target="_blank" v-bind:href=item.link>{{item.name}}</a></li>

how does a vue project dynamically add the value of the a tag rel attribute?

Jul.19,2021

<li><a id='nofollow' target="_blank" v-bind:href=item.link>{{item.name}}</a></li>

docoment.getElementById('nofollow').setAttribute('ref','nofollow')

http://www.w3school.com.cn/js.


<li><a :rel="item.rel" target="_blank" v-bind:href="item.link">{{item.name}}</a></li>

<li><a rel={{item.rel}} target="_blank" v-bind:href=item.link>{{item.name}}</li>

can't you make it a variable?


clipboard.png

clipboard.png
has been solved. The value of the rel attribute returned by the data is Booleans,. The inter-bar judgment is fine. Thank you for your help

.
Menu