mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(Steps): use relation
This commit is contained in:
parent
d762c23044
commit
75a8a394ca
@ -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');
|
||||
|
@ -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])}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user