import { createDecorator } from 'vue-class-component' ; import { inheritInjected , needToProduceProvide , produceProvide , } from '../helpers/provideInject' ; param key return export function Provide ( key ? ) { return createDecorator ( ( componentOptions , k ) => { let provide = componentOptions . provide ; inheritInjected ( componentOptions ) ; if ( needToProduceProvide ( provide ) ) { provide = componentOptions . provide = produceProvide ( provide ) ; } provide . managed [ k ] = key || k ; } ) ; }