feat: add usePublicApi

This commit is contained in:
chenjiahan
2020-08-31 16:57:49 +08:00
parent e1ac3f9a58
commit 0d64cf1b63
5 changed files with 32 additions and 39 deletions
+7
View File
@@ -0,0 +1,7 @@
import { getCurrentInstance } from 'vue';
// expose public api
export function usePublicApi(apis: Record<string, any>) {
const vm = (getCurrentInstance() as any).ctx;
Object.assign(vm, apis);
}