diff --git a/src/action-bar/index.js b/src/action-bar/index.js
index ee2623114..bcbb1830b 100644
--- a/src/action-bar/index.js
+++ b/src/action-bar/index.js
@@ -1,5 +1,5 @@
+import { ref, provide } from 'vue';
import { createNamespace } from '../utils';
-import { useChildren } from '../api/use-relation';
const [createComponent, bem] = createNamespace('action-bar');
@@ -14,7 +14,8 @@ export default createComponent({
},
setup(props, { slots }) {
- useChildren(ACTION_BAR_KEY);
+ const children = ref([]);
+ provide(ACTION_BAR_KEY, children);
return () => (
diff --git a/src/api/use-relation.ts b/src/api/use-relation.ts
index d7ab9a027..857ebf04d 100644
--- a/src/api/use-relation.ts
+++ b/src/api/use-relation.ts
@@ -1,15 +1,9 @@
-import { ref, Ref, provide, inject, computed, onUnmounted } from 'vue';
+import { Ref, inject, computed, onUnmounted } from 'vue';
export type Parent
= null | {
children: Ref[[]>;
};
-export function useChildren(key: string) {
- const children = ref([]);
- provide(key, { children });
- return children;
-}
-
export function useParent(key: string, child: Ref) {
const parent = inject>(key, null);
]