import { VueConstructor } from 'vue' ; import { InputComponent , createRootFnExtendOptions , createRootFn , Tail } from './interface' ; import CreateRootClassWrapFunction from './CreateRootClassWrapFunction' ; import createRoot from './createRoot' ; type createRoot = ( ( component : InputComponent , createRootFnExtendOptions : createRootFnExtendOptions ) => void ) & { version ? : string ; } ; declare module 'vue' { interface VueConstructor { createRoot : createRoot ; createRootClass : createRoot ; } } param { VueConstructor } Vue构造函数 param { String } Options . prefix param { String } Options . name function install ( Vue , { as = { $createRoot : '$createRoot' } } = { } ) { Vue . createRootClass = ( component , createRootFnExtendOptions ) => CreateRootClassWrapFunction ( Vue , component , createRootFnExtendOptions ) ; Vue . createRoot = Vue . createRootClass ; Vue . prototype [ as . $createRoot ] = ( ... args ) => createRoot ( Vue , ... args ) ; Vue . createRootClass . version = '__VERSION__' ; } export default { install } ;