原来一直使用angular,而vue的用法和angualr相似,故我默认以为vue的href添加拼接参数的写法为:

<a href="/list/editor?name={{item.title}}">链接</a>

然测试发现这是不可行的,需要用以下方法:

<a :href="'/list/editor?name='+item.title">链接</a>

 

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐