Vue 的`<router-link>` 在传入数据模板文字时不起作用?

问题描述

我通过了 <router-link>${...} 用于主页 而没有 ${...} 用于 登录 页面,但在通过时没有任何作用在模板中。

data(){
  return {
    content: `
        <p>Click ${<router-link to="{name: 'home'}">homepage</router-link>} 
        or <router-link to="/login">login</router-link> to proceed.</p>`
  },}

在模板中传递数据:

<h2 v-html="item.content"></h2>

输出为:

enter image description here

这是它在控制台中的样子:

enter image description here

任何人都可以帮忙使它作为 a 链接工作并转到路线吗?提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)