Home > other >  Sails.js How to add the src/href by the vuejs
Sails.js How to add the src/href by the vuejs

Time:11-20

<img src="{{ event.imageurl }}" alt="Placeholder image" />

<a class="title is-4" href="http://localhost:1337/detail/{{ event.id }}">{{ event.eventname }}</a>

event.imageurl and the <a> link is not able to show. But the other elements without link are correct to show on

Error in image and link

http://localhost:1337/detail/{{ event.id }}

error of link of <a>

Even I add : before src/href, it still doesn't work

CodePudding user response:

I know how to solve it

<img :src="event.imageurl" alt="Placeholder image" />
<a class="title is-4" :href="'http://localhost:1337/detail/'  event.id ">{{ event.eventname }}</a >

CodePudding user response:

You have to add : before src/href, and then remove {{}}

  • Related