1 獲取?后面的參數
http://192.168.1.105:8080/#/idInput?username=%22%E5%BC%A0%E4%B8%89%22
獲取參數方法 let id = this.$route.query.username
2 獲取不帶?的URL中的參數
http://192.168.1.12:8080/#/home/newsinfo/234
在路由中配置路由
{ path: '/home/newsinfo/:id', component: Newsinfo }
.vue頁面設置
<template>
<router-link :to="'/home/newsinfo/' + item.id">
</template>
獲取參數方法 let id = this.$route.params.id