Merge pull request #2523 from QingWei-Li/dynamic-steps

Steps: dynamic update step, fixed #2512
pull/2566/head
baiyaaaaa 2017-01-21 21:35:26 +08:00 committed by GitHub
commit 6bfcd2fb75
2 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@ export default {
}; };
}, },
created() { beforeCreate() {
this.$parent.steps.push(this); this.$parent.steps.push(this);
}, },

View File

@ -39,13 +39,13 @@ export default {
watch: { watch: {
active(newVal, oldVal) { active(newVal, oldVal) {
this.$emit('change', newVal, oldVal); this.$emit('change', newVal, oldVal);
} },
},
mounted() { steps(steps) {
this.steps.forEach((child, index) => { steps.forEach((child, index) => {
child.index = index; child.index = index;
}); });
}
} }
}; };
</script> </script>