vue 路由相关操作
生活随笔
收集整理的這篇文章主要介紹了
vue 路由相关操作
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
接收參數
index.js
{path: '/user/:userId',name: 'User',component: User }, <template><div><h2>我是用戶界面</h2><p>用戶信息</p><h2>{{ userId }}</h2><h2>{{ $route.params.userId }}</h2></div> </template><script>export default {name: "User",computed: {userId() {return this.$route.params.userId}}}</script>總結
以上是生活随笔為你收集整理的vue 路由相关操作的全部內容,希望文章能夠幫你解決所遇到的問題。