【问题标题】:Sails.js How to add the src/href by the vuejsSails.js 如何通过 vuejs 添加 src/href
【发布时间】:2021-12-30 17:05:22
【问题描述】:
<img src="{{ event.imageurl }}" alt="Placeholder image" />

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

event.imageurl&lt;a&gt; 链接无法显示。但是没有链接的其他元素可以正确显示

图片和链接错误

http://localhost:1337/detail/%7B%7B%20event.id%20%7D%7D

error of link of &lt;a&gt;

即使我在src/href 之前添加:,它仍然不起作用

【问题讨论】:

    标签: javascript html vue.js sails.js


    【解决方案1】:

    我知道怎么解决

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

    【讨论】:

      【解决方案2】:

      你必须在src/href之前添加:,然后删除{{}}

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-11-16
        • 2021-08-17
        • 1970-01-01
        • 2020-08-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多