chore(Steps): use relation

This commit is contained in:
chenjiahan 2020-09-26 11:00:08 +08:00
parent d762c23044
commit 75a8a394ca
2 changed files with 4 additions and 8 deletions

View File

@ -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');

View File

@ -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 () => (
<div class={bem([props.direction])}>