vue.js develop plug-ins arrested letter, how to open a new window in single-page applications

How to implement the project in vue jump to a new page (a simpler and more basic problem), there are two methods:
1, <vue-Link> tag to achieve new window opens
official document said v-link instructions <router-link> alternative assembly instructions, and <router-link> does not support target = "_ blank" attribute, if needed must be used to open a new window <a> labels, but in fact vue2 version <router-link> is support target = "_ blank" attribute (tag = "a"), as follows:

<router-link target="_blank" :to="{path:'/home',query:{id:'1'}}">新页面打开home页</router-link>

This method can not open a new page in the grasp of the letter iOS version of the APP. After practice we found below said second method can work in the grasp of the letter iOS version of the APP.
2, the navigation program
may be parsed using this $ router.resolve need to jump to url, then opened with the window.open, as follows:

let routeUrl = this.$router.resolve({
     path: "/share",
     query: {id:96}
   });
   window.open(routeUrl.href, '_blank');

Guess you like

Origin blog.51cto.com/kankan/2453529