UNPKG

uniapp-sfc-loader

Version:

修改自uniapp-router-view-loader,解决windows下路径问题

15 lines (11 loc) 355 B
import { inject } from 'vue'; import { provideKey } from '../../../config'; type ComponentOpts = { [key: string]: { [key: string]: any }; }[]; type ComponentInjectRes<T> = { [K in keyof T]: () => T[K]; }; export const componentInject = <ComponentOpts>() => { return inject(provideKey) as ComponentInjectRes<ComponentOpts>; };