HTML中:

<el-button  type="primary" class="r" @click="getUrl">按钮</el-button>

methods中:
getUrl(){
let routeData = this.$router.resolve({ path: '/test' });
window.open(routeData.href, '_blank');
},

路由文件 router/index.js中:
{
path: '/test',
component: () => import('@/views/newPage/test'),
hidden: true
},




转载于:https://www.cnblogs.com/benbenbai/p/10728829.html

Logo

前往低代码交流专区

更多推荐