Skip to content

Commit

Permalink
fix(steps): fix readonly non working
Browse files Browse the repository at this point in the history
  • Loading branch information
k1nz committed May 11, 2022
1 parent 9a81092 commit b563c94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/steps/demos/status.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<template>
<div>
<t-steps current="FINISH" readonly>
<t-step-item title="已完成的步骤" content="这里是提示文字" />
<t-step-item title="已完成的步骤" content="这里是提示文字" />
<t-step-item title="已完成的步骤" content="这里是提示文字" />
<t-step-item title="已完成的步骤" content="这里是提示文字" />
</t-steps>
<div style="margin: 16px 0" />
<t-steps :current="1" readonly>
<t-step-item title="已完成的步骤" content="这里是提示文字" />
<t-step-item title="进行中的步骤" content="这里是提示文字" />
Expand Down
1 change: 1 addition & 0 deletions src/steps/step-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default defineComponent({
// when props.value is undefined
const index = ref(-1);
const onStepClick = (e: MouseEvent) => {
if (!canClick.value) return;
const val = props.value === undefined ? index.value : props.value;
steps.setCurrent(val, steps.current, { e });
};
Expand Down

0 comments on commit b563c94

Please sign in to comment.