Vue2使用location.href导航到外部URL

vue.js Vue.js

西门Eva小胖

2020-03-19

我试图使用router.go,router.push,router.replace和window.location.href转到“ www.mytargeturl.org”以重定向我的vuejs应用程序,但我总是得到myVueapp.com/www.mytargeturl.org,这是我的路线:

  routes:[
{path: '/', component: App,
  children:[
    {
      path: 'detail',
      component: ItemDetail,
      props: true
    },
    {
      path: 'search',
      component: Middle
    }       
  ]
},   
{
  path: '/test', component: Test
},
{ path: '/a', redirect: 'www.mytargeturl.org' } // also tried this but didnt work

]

第2406篇《Vue2使用location.href导航到外部URL》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android