From 75a8a394ca503e422f082506d661566307baa431 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 26 Sep 2020 11:00:08 +0800 Subject: [PATCH] chore(Steps): use relation --- src/step/index.js | 2 +- src/steps/index.js | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/step/index.js b/src/step/index.js index db90f684b..346bcd8ea 100644 --- a/src/step/index.js +++ b/src/step/index.js @@ -2,7 +2,7 @@ import { computed } from 'vue'; import { createNamespace } from '../utils'; import { BORDER } from '../utils/constant'; import { STEPS_KEY } from '../steps'; -import { useParent } from '../composition/use-parent'; +import { useParent } from '../composition/use-relation'; import Icon from '../icon'; const [createComponent, bem] = createNamespace('step'); diff --git a/src/steps/index.js b/src/steps/index.js index d5633d035..0fc6f6a3f 100644 --- a/src/steps/index.js +++ b/src/steps/index.js @@ -1,5 +1,5 @@ -import { provide, reactive } from 'vue'; import { createNamespace } from '../utils'; +import { useChildren } from '../composition/use-relation'; const [createComponent, bem] = createNamespace('steps'); @@ -27,13 +27,9 @@ export default createComponent({ emits: ['click-step'], setup(props, { emit, slots }) { - const children = reactive([]); + const { linkChildren } = useChildren(STEPS_KEY); - provide(STEPS_KEY, { - emit, - props, - children, - }); + linkChildren({ emit, props }); return () => (