nicecode-v2/packages/slave
2024-03-26 18:04:26 +08:00
..
es fix: 忽略所有上传 2024-03-24 13:53:42 +08:00
lib fix: 忽略所有上传 2024-03-24 13:53:42 +08:00
src fix(biz): 添加 traansfer 组件 searchProps 透传 2024-03-26 18:04:26 +08:00
.fatherrc.ts fix: 添加slave包 2024-03-22 09:17:08 +08:00
CHANGELOG.md fix: 添加slave包 2024-03-22 09:17:08 +08:00
index.d.ts fix: 添加slave包 2024-03-22 09:17:08 +08:00
package.json fix: 忽略所有上传 2024-03-24 13:53:42 +08:00
README.md fix(biz): 添加 traansfer 组件 searchProps 透传 2024-03-26 18:04:26 +08:00

@zhst/slave

介绍

供微前端应用使用的公共方法

安装

pnpm install @zhst/slave

使用

import React from 'react';
import slave from '@zhst/slave'

slave.init({
  jumpUrl: `http://10.0.0.222:30058/metarial/login`,
  to: 'http://www.baidu.com',
  jumpToLogin: false,
  tokenKey: 'token',
})
export default () => <div>测试</div>

API

参数 说明 类型 默认值 版本
jumpToLogin 是否打开登录校验跳转 boolean true -
jumpUrl 登录跳转页面 string - -
tokenKey 从链接获取的登录校验字段 string token -
showMsg 是否显示“请先登录”提示框 boolean true -
msgText 提示框自定义文案 string 请先登录 -
from 来自哪个链接(可选) string - -
to 准备去的链接(可选) string - -

slave 实例方法

方法 说明 类型 默认值 版本
init 初始化实例 function (data: SlaveProps) => void -
logOut 退出登录 function () => void -