import { VueConstructor , VNodeData } from 'vue/types' ; import { InputComponent , ChildrenRender , RootComponent , createRootFnExtendOptions , CRootInstance } from './interface' ; import createRoot from './createRoot' ; export default ( Vue , inputComponent , globalcreateRootFnExtendOptions ? ) => { let cRootInstance ; return class CreateRoot { /**
         * 创建单例
         */ static init = ( options , childrenRender ? ) => { if ( cRootInstance ) { cRootInstance . $update ( options , childrenRender ) ; } else { cRootInstance = new CreateRoot ( options , childrenRender ) ; } } ; /**
         * 更新单例
         */ static $update = ( options , childrenRender ? ) => { if ( undefined !== cRootInstance && null !== cRootInstance ) { cRootInstance . $update ( options , childrenRender ) ; } } ; /**
         * 销毁单例
         */ static $destroy = ( ) => { if ( null !== cRootInstance ) { cRootInstance . $destroy ( ) ; cRootInstance = null ; } } ; component : RootComponent ; constructor ( options , childrenRender ? ) { this . component = createRoot ( Vue , inputComponent , options , childrenRender , globalcreateRootFnExtendOptions ) ; return this ; } $update ( ... args ) { this . component . $updateRenderData ( ... args ) ; return this . component ; } $destroy ( ) { this . component . $destroy ( ) ; return this ; } } ; } ;