diff --git a/packages/components/steps/src/index.vue b/packages/components/steps/src/index.vue index 3c5d9b2494..680dc57016 100644 --- a/packages/components/steps/src/index.vue +++ b/packages/components/steps/src/index.vue @@ -1,10 +1,5 @@ @@ -13,6 +8,7 @@ import { defineComponent, watch, ref, provide } from 'vue' import { CHANGE_EVENT } from '@element-plus/constants' +import { useNamespace } from '@element-plus/hooks' export default defineComponent({ name: 'ElSteps', @@ -54,6 +50,7 @@ export default defineComponent({ }, emits: [CHANGE_EVENT], setup(props, { emit }) { + const ns = useNamespace('steps') const steps = ref([]) watch(steps, () => { @@ -73,6 +70,7 @@ export default defineComponent({ return { steps, + ns, } }, }) diff --git a/packages/components/steps/src/item.vue b/packages/components/steps/src/item.vue index 1acea614ef..5103893a21 100644 --- a/packages/components/steps/src/item.vue +++ b/packages/components/steps/src/item.vue @@ -2,43 +2,43 @@
-
-
- +
+
+
-
+
- + -
+
{{ index + 1 }}
- +
-
-
+
+
{{ title }}
-
-
+
+
{{ description }}
@@ -60,6 +60,7 @@ import { import { ElIcon } from '@element-plus/components/icon' import { Close, Check } from '@element-plus/icons-vue' +import { useNamespace } from '@element-plus/hooks' import type { Ref, PropType, Component } from 'vue' export interface IStepsProps { @@ -112,6 +113,7 @@ export default defineComponent({ }, }, setup(props) { + const ns = useNamespace('step') const index = ref(-1) const lineStyle = ref({}) const internalStatus = ref('') @@ -222,6 +224,7 @@ export default defineComponent({ parent.steps.value = [...parent.steps.value, stepItemState] return { + ns, index, lineStyle, currentStatus,