I got this error
Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of
<div id="{{ val }}">
, use<div :id="val">
.
on this line
<a href="/Library/@Model.Username/{{myVueData.Id}}">
It works in Angular 1. How do you do it in Vue?
In your template:
And you put
href
indata
:Or use a computed property:
you can either use the shorthand
:
orv-bind
or for when you need more than just binding an attribute you can also do:
Use javascript code inside
v-bind
(or shortcut ":") :and
Update Answer
Some directives can take an “argument”, denoted by a colon after the directive name. For example, the
v-bind
directive is used to reactively update an HTML attribute:Here
href
is the argument, which tells thev-bind
directive to bind the element’shref
attribute to the value of the expression url. You may have noticed this achieves the same result as an attribute interpolation usinghref="{{url}}"
: that is correct, and in fact, attribute interpolations are translated intov-bind
bindings internally.