iframe微前端集成, 顶部tab页操作
方法名 | 说明 | 参数 | 类型 |
---|---|---|---|
closeTabAsIframe | 关闭操作; 参数为要关闭tab的路径 | routePath | string |
closeAndOpenTabAsIframe | 关闭当前tab并新开tab | {openRoute(参数如下),closeTabName:'/xx/xx',message:''} | object |
openTabAsIframe | 新开tab | openRoute | object |
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
urlPath | string | 是 | tab页对应的路由(需加上子应用前缀) |
title | string | 是 | tab页标题 |
params | object | 否 | params路由参数 |
query | object | 否 | query路由参数 |
<template>
<el-button type="primary" @click="closeAndOpenTabAsIframe({openRoute,closeTabName: '/console/user/add',message:'用户添加成功!' })">关闭当前tab并打开新的tab页</el-button>
</template>
<script>
import {closeAndOpenTabAsIframe} from 'iframe-tab-sdk'
export default {
data() {
return {
openRoute: {
urlPath: '/console/user/list',
title: '新tab',
params: {}, // 非必填
query: {}, // 非必填
}
}
},
methods: {
closeAndOpenTabAsIframe
}
}
</script>