我尝试在href中的URL中设置一个动态值。我正在使用Vue.js
<a
href="https://example.com/glasses/guide-for-uploading"
target="_blank"
>
Check it here
</a>所以在URL中间,我需要用productName替换眼镜。如何在此链接中正确完成此操作?我不确定是不是简单的数据绑定。
发布于 2020-09-23 23:27:03
是的,您可以使用数据绑定。
<a
:href="`https://example.com/glasses/${productName}`"
target="_blank"
>
Check it here
</a>https://stackoverflow.com/questions/64031262
复制相似问题