mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(Skeleton): use tsx
This commit is contained in:
parent
5370eaafce
commit
6341967482
@ -66,4 +66,4 @@ export default {
|
||||
| round `v2.8.5` | 是否将标题和段落显示为圆角风格 | _boolean_ | `false` |
|
||||
| title-width | 标题占位图宽度 | _number \| string_ | `40%` |
|
||||
| avatar-size | 头像占位图大小 | _number \| string_ | `32px` |
|
||||
| avatar-shape | 头像占位图形状,可选值为`square` | _string_ | `round` |
|
||||
| avatar-shape | 头像占位图形状,可选值为 `square` | _string_ | `round` |
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { PropType } from 'vue';
|
||||
import { createNamespace, addUnit, getSizeStyle } from '../utils';
|
||||
|
||||
const [createComponent, bem] = createNamespace('skeleton');
|
||||
@ -26,7 +27,7 @@ export default createComponent({
|
||||
default: '32px',
|
||||
},
|
||||
avatarShape: {
|
||||
type: String,
|
||||
type: String as PropType<'square' | 'round'>,
|
||||
default: 'round',
|
||||
},
|
||||
titleWidth: {
|
||||
@ -34,7 +35,9 @@ export default createComponent({
|
||||
default: '40%',
|
||||
},
|
||||
rowWidth: {
|
||||
type: [Number, String, Array],
|
||||
type: [Number, String, Array] as PropType<
|
||||
number | string | (number | string)[]
|
||||
>,
|
||||
default: DEFAULT_ROW_WIDTH,
|
||||
},
|
||||
},
|
||||
@ -62,7 +65,7 @@ export default createComponent({
|
||||
}
|
||||
};
|
||||
|
||||
const getRowWidth = (index) => {
|
||||
const getRowWidth = (index: number) => {
|
||||
const { rowWidth } = props;
|
||||
|
||||
if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {
|
||||
@ -77,7 +80,7 @@ export default createComponent({
|
||||
};
|
||||
|
||||
const renderRows = () => {
|
||||
const Rows = [];
|
||||
const Rows: JSX.Element[] = [];
|
||||
|
||||
for (let i = 0; i < props.row; i++) {
|
||||
Rows.push(
|
Loading…
x
Reference in New Issue
Block a user