This commit is contained in:
2026-01-05 12:47:14 +08:00
commit 1fc846fae3
1614 changed files with 162035 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<script setup lang="ts">
import type { ComponentInternalInstance } from 'vue'
import { computed, defineComponent, provide, reactive } from 'vue'
import { PREFIX } from '../_constants'
import { getMainClass } from '../_utils'
import { stepsEmits, stepsProps } from './steps'
const props = defineProps(stepsProps)
const emit = defineEmits(stepsEmits)
const state = reactive({
children: [] as ComponentInternalInstance[],
})
const classes = computed(() => {
return getMainClass(props, componentName, {
[`${componentName}-${props.direction}`]: true,
[`${componentName}-dot`]: !!props.progressDot,
})
})
function relation(child: ComponentInternalInstance) {
child && state.children.push(child as any)
}
function onEmit(index: number) {
emit('clickStep', index)
}
provide('parent', {
relation,
state,
props,
onEmit,
})
</script>
<script lang="ts">
const componentName = `${PREFIX}-steps`
export default defineComponent({
name: componentName,
options: {
virtualHost: true,
addGlobalClass: true,
styleIsolation: 'shared',
},
})
</script>
<template>
<view :class="classes" :style="customStyle">
<slot />
</view>
</template>
<style lang="scss">
@import './index';
</style>