fix(steps): add props validator

This commit is contained in:
Caaalabash 2020-08-14 16:13:34 +08:00 committed by jeremywu
parent 4438a08aca
commit 10394abde0
2 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ export default defineComponent({
direction: {
type: String,
default: 'horizontal',
validator: (val: string): boolean => ['horizontal', 'vertical'].indexOf(val) > -1,
},
alignCenter: {
type: Boolean,
@ -33,10 +34,12 @@ export default defineComponent({
finishStatus: {
type: String,
default: 'finish',
validator: (val: string): boolean => ['wait', 'process', 'finish', 'error', 'success'].indexOf(val) > -1,
},
processStatus: {
type: String,
default: 'process',
validator: (val: string): boolean => ['wait', 'process', 'finish', 'error', 'success'].indexOf(val) > -1,
},
},
setup(props) {

View File

@ -84,6 +84,7 @@ export default defineComponent({
status: {
type: String,
default: '',
validator: (val: string): boolean => ['', 'wait', 'process', 'finish', 'error', 'success'].indexOf(val) > -1,
},
},
setup(props) {