iframe-tab-sdk 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/index.js +1 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@ iframe微前端集成, 顶部tab页操作;支持独立运行
|
|
|
5
5
|
## API
|
|
6
6
|
|方法名|说明|参数|类型
|
|
7
7
|
|:----|:----|:----|:----
|
|
8
|
-
|openTab|打开tab页|
|
|
9
|
-
|refreshTab|刷新tab页|
|
|
8
|
+
|openTab|打开tab页|[openRoute](#openroute-attributes),详见下表|object
|
|
9
|
+
|refreshTab|刷新tab页|[openRoute](#openroute-attributes)|object
|
|
10
10
|
|closeTab|关闭tab页|urlPath|string
|
|
11
11
|
|logout|退出登录|无|无
|
|
12
12
|
|reload|刷新主应用网页|无|无
|
|
13
|
-
|closeAndOpenTab|关闭当前tab并新开tab|
|
|
13
|
+
|closeAndOpenTab|关闭当前tab并新开tab|{ [openRoute](#openroute-attributes), closeTabName,message }|object
|
|
14
14
|
|fullscreen|全屏/退出全屏|isFullScreen|boolean
|
|
15
15
|
|
|
16
16
|
### openRoute Attributes
|
|
@@ -27,7 +27,7 @@ iframe微前端集成, 顶部tab页操作;支持独立运行
|
|
|
27
27
|
## 示例(vue+elementui)
|
|
28
28
|
``` vue
|
|
29
29
|
<template>
|
|
30
|
-
<el-button type="primary" @click="closeAndOpenTab(
|
|
30
|
+
<el-button type="primary" @click="closeAndOpenTab({openRoute,closeTabName: '/console/user/add',message:'用户添加成功!' })">关闭当前tab并打开新的tab页</el-button>
|
|
31
31
|
</template>
|
|
32
32
|
<script>
|
|
33
33
|
import {closeAndOpenTabAsIframe} from 'iframe-tab-sdk'
|
|
@@ -48,4 +48,4 @@ export default {
|
|
|
48
48
|
}
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
|
-
```
|
|
51
|
+
```
|
package/index.js
CHANGED
|
@@ -69,7 +69,6 @@ function navigateTo(urlPath, query = {}) {
|
|
|
69
69
|
* @param {String} params[name] 页面名称
|
|
70
70
|
* @param {String} params[title] 页面标题
|
|
71
71
|
* @param {Object} params[query] query 参数
|
|
72
|
-
* @param {Boolean} params[refreshClearQuery] 是否清空路由参数
|
|
73
72
|
*
|
|
74
73
|
*/
|
|
75
74
|
export function openTab(urlPath, params) {
|
|
@@ -144,7 +143,7 @@ export function logout() {
|
|
|
144
143
|
window.parent.postMessage({ type: "logout" }, origin);
|
|
145
144
|
} else {
|
|
146
145
|
// 非iframe环境,直接执行登出逻辑
|
|
147
|
-
window.location.href = '/';
|
|
146
|
+
window.location.href = '/logout';
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iframe-tab-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "门户iframe集成子应用顶部tab页管理",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"private": false,
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
},
|
|
11
11
|
"keywords": ["iframe", "tab", "集成", "微前端"],
|
|
12
12
|
"author": "wy",
|
|
13
|
-
"license": "
|
|
14
|
-
}
|
|
13
|
+
"license": "MIT"
|
|
14
|
+
}
|