mirror of
https://github.com/youzan/vant.git
synced 2026-04-04 02:00:25 +08:00
chore(Steps): use relation
This commit is contained in:
@@ -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])}>
|
||||
|
||||
Reference in New Issue
Block a user