當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JS页面跳转的各种形式
生活随笔
收集整理的這篇文章主要介紹了
JS页面跳转的各种形式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
字符串
this.$router.push('/home/first')對象
this.$router.push({ path: '/home/first' })命名的路由(可以傳遞參數)
this.$router.push({ name: 'home', params: { userId: wise }})打開新頁面跳轉
let routeData = this.$router.resolve({ path: '/salary/day', query: { id: id} });window.open(routeData.href, '_blank');如果需要傳遞參數:
this.props.router.push({ pathname : '/', state : { msg : 'you have logined and will redirect to your page'}}); this.context.router.push({ pathname : '/', state : { msg : 'you have logined and will redirect to your page'}});總結
以上是生活随笔為你收集整理的JS页面跳转的各种形式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用systemctl命令管理syste
- 下一篇: gradle idea java ssm