File tree Expand file tree Collapse file tree 5 files changed +73
-1
lines changed Expand file tree Collapse file tree 5 files changed +73
-1
lines changed Original file line number Diff line number Diff line change 55 "author" : " mqhe2007 <122274389@qq.com>" ,
66 "homepage" : " https://mengqinghe.com" ,
77 "main" : " dist/index.js" ,
8+ "typings" : " types/index.d.ts" ,
89 "files" : [
9- " dist"
10+ " dist" ,
11+ " types"
1012 ],
1113 "license" : " MIT" ,
1214 "keywords" : [
Original file line number Diff line number Diff line change 1+ import Vue from 'vue'
2+
3+ export declare class DynamicComponent {
4+ /**
5+ * 创建动态组件
6+ * @param component 组件
7+ * @param position 插槽,默认GLOBAL
8+ */
9+ create ( component : Vue , position : string ) : void ;
10+
11+ /**
12+ * 删除动态组件方法
13+ * @param name 组件名称
14+ * @param position 插槽,默认GLOBAL
15+ */
16+ destroy ( name : string , position : string ) : void ;
17+ }
Original file line number Diff line number Diff line change 1+ export declare class EventBus {
2+ /**
3+ * 触发事件
4+ * @param eventName 事件名称
5+ * @param payload 事件载荷
6+ */
7+ emit ( eventName : string , payload : any ) : void ;
8+
9+ /**
10+ * 监听事件
11+ * @param eventName 事件名称
12+ * @param handler 事件处理器
13+ */
14+ on ( eventName : string , handler : Function ) : void ;
15+
16+
17+ /**
18+ * 取消监听事件
19+ * @param eventName 事件名称
20+ * @param handler 事件处理器
21+ */
22+ off ( eventName : string , handler : Function ) : void ;
23+
24+ /**
25+ * 清理事件总线
26+ */
27+ clear ( ) : void ;
28+
29+ /**
30+ * 获取事件总线详情
31+ */
32+ getEvents ( ) : object ;
33+ }
Original file line number Diff line number Diff line change 1+ import vueModuleLoader from './vue-module-loader' ;
2+
3+ export default vueModuleLoader ;
Original file line number Diff line number Diff line change 1+ import { PluginFunction } from 'vue' ;
2+ import { DynamicComponent } from './dynamic-component'
3+ import { EventBus } from './event-bus'
4+
5+ interface VueModuleLoader extends PluginFunction < any > {
6+ }
7+
8+ declare const vueModuleLoader : VueModuleLoader ;
9+ export default vueModuleLoader ;
10+
11+ declare module 'vue/types/vue' {
12+ interface Vue {
13+ $eventBus : EventBus ;
14+ $dynamicComponent : DynamicComponent ;
15+ $moduleLoader : ( module : Function | object ) => Promise < any > ;
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments