1.0.0 • Published 1 year ago

iframe-tab-sdk v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

iframe-tab-sdk

iframe微前端集成, 顶部tab页操作

API

方法名说明参数类型
closeTabAsIframe关闭操作; 参数为要关闭tab的路径routePathstring
closeAndOpenTabAsIframe关闭当前tab并新开tab{openRoute(参数如下),closeTabName:'/xx/xx',message:''}object
openTabAsIframe新开tabopenRouteobject

openRoute Attributes

参数类型必填说明
urlPathstringtab页对应的路由(需加上子应用前缀)
titlestringtab页标题
paramsobjectparams路由参数
queryobjectquery路由参数

示例(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>