-
-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function typeValidator(type: string): boolean { | ||
const validTypes = ['wave', 'cube', 'rect', 'disappear'] | ||
return validTypes.includes(type) | ||
} | ||
|
||
function sizeValidator(size: string): boolean { | ||
const validSizes = ['normal', 'mini', 'small', 'large'] | ||
|
||
return validSizes.includes(size) | ||
} | ||
|
||
export const props = { | ||
// loading类型 | ||
type: { | ||
type: String, | ||
default: 'wave', | ||
validator: typeValidator, | ||
}, | ||
// loading尺寸 | ||
size: { | ||
type: String, | ||
default: 'normal', | ||
validator: sizeValidator, | ||
}, | ||
// loading颜色 | ||
color: { | ||
type: String, | ||
default: 'currentColor', | ||
}, | ||
// 文字颜色 | ||
fontColor: { | ||
type: String, | ||
default: '#ccc', | ||
}, | ||
// 字体大小 | ||
fontSize: { | ||
type: Number, | ||
default: 14, | ||
}, | ||
// 是否垂直排列图标和文字内容 | ||
vertical: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
} |