我有一个道具,它应该通过“职业/随便什么-条目-这里”,我正在尝试使用路由器链接来设置它。
<router-link v-if="!buttonLink" :to="buttonEntry" exact class="bunch-of-classes-here">
Click Here
</router-link>
我希望链接呈现为"http://localhost:3000/careers/whatever-entry-here“--但我得到的却是"http://localhost:3000/whatever-entry-here"”。
我到处都找过了,但是我似乎不能让它把文件夹传递给URI。
当我在模板中的其他地方输出{{ buttonEntry }}时,它会输出“careers/ When entry-here”
有什么建议吗?
发布于 2021-08-12 22:42:59
啊哈。在URI之前需要一个'/‘,但API没有返回。
通过将代码更改为:
<router-link v-if="!buttonLink" :to="`/`+buttonEntry" exact class="bunch-of-classes-here">
Click Here
</router-link>
https://stackoverflow.com/questions/68764733
复制相似问题