@xingtukeji/micro 1.0.8 → 1.0.10

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.
@@ -1,4 +1,4 @@
1
- import { AppOption, App } from './index.d';
1
+ import { AppOption, App } from './types';
2
2
  import { microInit } from './child';
3
3
  /**
4
4
  * 安装微应用
@@ -1,4 +1,4 @@
1
- import { MicroInitOptions } from './index.d';
1
+ import { MicroInitOptions } from './types';
2
2
  /**
3
3
  * 微应用-子应用初始化
4
4
  * 此时方法上下文是子应用
@@ -1,29 +1,8 @@
1
- import { MicroApp } from './parent';
2
- import { default as microInit } from './index';
3
- export interface AppOption {
4
- name: string
5
- url: string
6
- el?: HTMLElement | string
7
- preload?: boolean
8
- token?: () => string | string
9
- params?: { [key: string]: any }
10
- sync?: boolean
11
- }
12
- export interface App extends AppOption {
13
- instance: MicroApp
14
- }
15
- export interface MicroInitOptions {
16
- hideHeaderCssSelector?: string
17
- authHandler?: (token: string) => void
18
- }
19
-
20
- // 扩展 Window 接口,防止ts报错
21
- declare global {
22
- interface Window {
23
- [key: string]: any
24
- }
25
- }
26
-
27
-
28
- export * from './api'
29
- export default microInit
1
+ import { App } from 'vue';
2
+ import { default as XTMicroView } from './components/XTMicroView.vue';
3
+ export { XTMicroView };
4
+ export * from './api';
5
+ declare const _default: {
6
+ install: (app: App, _options?: any) => void;
7
+ };
8
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { AppOption, App } from './index.d';
1
+ import { AppOption, App } from './types';
2
2
  export declare const isMicro: import('vue').Ref<boolean>;
3
3
  export declare class MicroApp {
4
4
  app: App | AppOption;
@@ -25,5 +25,6 @@ export declare class MicroApp {
25
25
  }
26
26
  /**
27
27
  * 初始化主应用微前端
28
+ * 包括:监听子应用消息,同步子应用路由到主应用上
28
29
  */
29
30
  export declare const mainMicroInit: () => void;
@@ -1 +1,25 @@
1
+ import { MicroApp } from './parent';
1
2
  export declare const CONSTANT: Record<string, string>;
3
+ export interface AppOption {
4
+ name: string;
5
+ url: string;
6
+ el?: HTMLElement | string;
7
+ preload?: boolean;
8
+ token?: () => string | string;
9
+ params?: {
10
+ [key: string]: any;
11
+ };
12
+ sync?: boolean;
13
+ }
14
+ export interface App extends AppOption {
15
+ instance: MicroApp;
16
+ }
17
+ export interface MicroInitOptions {
18
+ hideHeaderCssSelector?: string | string[];
19
+ authHandler?: (token: string) => void;
20
+ }
21
+ declare global {
22
+ interface Window {
23
+ [key: string]: any;
24
+ }
25
+ }
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@xingtukeji/micro",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "development": "./src/index.js",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
8
15
  "author": "",
9
16
  "license": "ISC",
10
17
  "publishConfig": {