1.0.0 • Published 3 years ago
iframe-tab-sdk v1.0.0
iframe-tab-sdk
iframe微前端集成, 顶部tab页操作
API
| 方法名 | 说明 | 参数 | 类型 |
|---|---|---|---|
| closeTabAsIframe | 关闭操作; 参数为要关闭tab的路径 | routePath | string |
| closeAndOpenTabAsIframe | 关闭当前tab并新开tab | {openRoute(参数如下),closeTabName:'/xx/xx',message:''} | object |
| openTabAsIframe | 新开tab | openRoute | object |
openRoute Attributes
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| urlPath | string | 是 | tab页对应的路由(需加上子应用前缀) |
| title | string | 是 | tab页标题 |
| params | object | 否 | params路由参数 |
| query | object | 否 | query路由参数 |
示例(vue+elementui)
<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>1.0.0
3 years ago