vue组件属性中字符串如何拼接变量?

let hot = {
    props: ['icon', 'name', 'id', 'theme', 'post', 'slgon'],
    template: `<li>
                  <img :src="icon" :alt="name" class="l">
                  <div class="list-item l">
                    <h3><a href="/forum/list/?id={{ id }}" >{{ name }}</a></h3>
                    <p class="slgon">{{ slgon }}</p>
                  </div>
                </li>`
  }

href="/forum/list/?id={{ id }}"

这样的如何进行拼接?

阅读 45.4k
评论
    4 个回答
    • 9.4k

    template:

    v-link="{name:'news_content', params:{news_id: res.news_id}}"

    router:

     '/news_content/:news_id':{
        name:'news_content',
        component:require(componentPath+'newsContent.vue')
      },
      相似问题
      推荐文章