@thingjs/xplugin-core
Version:
xplugin核心组件包,完成插件生命周期配置实现
71 lines (58 loc) • 1.78 kB
TypeScript
import BaseXPlugin from '../BaseXPlugin';
/**
* @extends BaseXPlugin
* @file 扩展插件::生命周期定义
* @author 张光 <zhangguang@uino.com>
* @date 2022.07.27
* @copyright uino 2022
* @version Revision
* @description ThingJS-X 扩展插件基类
* @description 扩展插件是『 ThingJS-X 零代码平台 』的载入全生命周期插件;
* @class ExpandPlugin
* @constructor
* @property readonly name 获取资源(插件)名称
* @property readonly viewName 获取资源UI组件定义名称
*/
declare class ExpandPlugin extends BaseXPlugin{
/**
* @class ExpandPlugin
* @constructor
* @param VueComponent 插件UI实例
* @param name 插件名称
*/
constructor(VueComponent: Object,name: string);
/**
* UI 注册名称
*/
readonly viewName:string;
/**
* @description 插件被激活完成后
* @param widget 插件关联 VUE组件实例
*/
onActivate(widget: Object):boolean | Promise<boolean>;
/**
* @description 插件被取消激活完成后
* @param widget 插件关联 VUE组件实例
*/
onDeactivate(widget: Object):boolean | Promise<boolean>;
}
export default ExpandPlugin;
/**
* @todo 插件生命周期方法暂不实现
*
* @method onInited::插件安装渲染完成后载入
* @method onDestroyed::插件销毁完成后载入
*/
// /**
// * @description 插件安装渲染完成后载入
// * @param instance Vue组件实例
// */
// onInited(instance:any);
// /**
// * 插件销毁完成后载入
// */
// onDestroyed();
// destroyElement() {
// this.$destroy(true);
// this.$el.parentNode.removeChild(this.$el);
// },