Commit d1255684 authored by Jeff Wen's avatar Jeff Wen Committed by Zhi Cun

Steps: fixes issue #14502 (#14596)

* Steps: fixes issue #14502

* Update

* f
parent d26809cb
...@@ -173,6 +173,10 @@ export default { ...@@ -173,6 +173,10 @@ export default {
mounted() { mounted() {
const unwatch = this.$watch('index', val => { const unwatch = this.$watch('index', val => {
this.$watch('$parent.active', this.updateStatus, { immediate: true }); this.$watch('$parent.active', this.updateStatus, { immediate: true });
this.$watch('$parent.processStatus', () => {
const activeIndex = this.$parent.active;
this.updateStatus(activeIndex);
}, { immediate: true });
unwatch(); unwatch();
}); });
} }
......
...@@ -59,6 +59,29 @@ describe('Steps', () => { ...@@ -59,6 +59,29 @@ describe('Steps', () => {
}); });
}); });
it('update processStatus', done => {
vm = createVue({
template: `
<el-steps :active="1" :process-status="processStatus">
<el-step title="abc"></el-step>
<el-step title="abc2"></el-step>
</el-steps>
`,
data() {
return { processStatus: 'error' };
}
});
vm.$nextTick(_ => {
expect(vm.$el.querySelectorAll('.el-step__head.is-error')).to.length(1);
vm.processStatus = 'process';
vm.$nextTick(_ => {
expect(vm.$el.querySelectorAll('.el-step__head.is-process')).to.length(1);
done();
});
});
});
it('finishStatus', done => { it('finishStatus', done => {
vm = createVue(` vm = createVue(`
<el-steps :active="1" finish-status="error"> <el-steps :active="1" finish-status="error">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment