Skip to content

Commit

Permalink
Davidnixon feat progress events (#1222)
Browse files Browse the repository at this point in the history
* feat: emit event on progress step click. update story book & update md

* feat: add emit from cv-progress

Co-authored-by: David Nixon <>
  • Loading branch information
lee-chase authored Jul 12, 2021
1 parent 6088957 commit 0e27a83
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ NOTE: steps is an array of strings declared elsewhere.

## Events

Clicking on the steps raise step-cliked events.
Clicking on the steps raise step-clicked events either directly from the step or from cv-progress if steps array used.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:class="[`${carbonPrefix}--progress-label`, { [`${carbonPrefix}--progress-label-overflow`]: showOverflow }]"
@mouseenter="onMouseEnter"
@mouseleave="onMouseLeave"
@click="$emit('step-clicked')"
@click="$emit('step-clicked', $event)"
ref="label"
>
{{ label }}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/cv-progress/cv-progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:label="step"
:complete="initialStep > index"
ref="steps"
@step-clicked="$emit('step-clicked', $event)"
/>
</slot>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion storybook/stories/cv-progress-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for (const story of storySet) {

// ----------------------------------------------------------------

let templateString = `<cv-progress${settings.group.attr}>${settings.group.slots}</cv-progress>`;
let templateString = `<cv-progress${settings.group.attr} @step-clicked="actionStepClicked">${settings.group.slots}</cv-progress>`;
// console.log(templateString);
// ----------------------------------------------------------------
const templateViewString = `
Expand Down

0 comments on commit 0e27a83

Please sign in to comment.