vue router-link to路径里面怎么怎么绑定参数?

参数id是父组件传过来的id,现在需要访问路径为localhost:8080/#/article/1111的组件,1111为传递的参数,那么to怎么写?
这样写:

<router-link to="'/article/'+id">

貌似不对

阅读 5.1k
3 个回答

clipboard.png

对应的路由
clipboard.png

结果显示

http://localhost:8081/#/news/comment/1573921
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题