refactor(Rate): refactor with composition api

This commit is contained in:
chenjiahan
2020-08-27 14:20:37 +08:00
parent 5aa092519a
commit 67f418ab07
2 changed files with 76 additions and 86 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import { watch, inject, WatchSource, getCurrentInstance } from 'vue';
import { FIELD_KEY } from '../field';
export function useParentField(watchSource: WatchSource) {
const field = inject(FIELD_KEY) as any;
const field = inject(FIELD_KEY, null) as any;
if (field && !field.children) {
field.children = getCurrentInstance()!.proxy;