Skip to content

Commit

Permalink
perf(step-item): listen for change in status to update the curStatus (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
betavs authored Dec 14, 2023
1 parent d6c3fc8 commit a50b3d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/step-item/step-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export default class StepItem extends SuperComponent {
sequence: 'positive',
};

observers = {
status(value) {
const { curStatus } = this.data;

if (curStatus === '' || value === curStatus) return;

this.setData({ curStatus: value });
},
};

methods = {
updateStatus({ current, currentStatus, index, theme, layout, items, sequence }) {
let curStatus = this.data.status;
Expand Down

0 comments on commit a50b3d4

Please sign in to comment.