mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +08:00
chore(Skeleton): use tsx
This commit is contained in:
parent
5370eaafce
commit
6341967482
@ -1,3 +1,4 @@
|
|||||||
|
import { PropType } from 'vue';
|
||||||
import { createNamespace, addUnit, getSizeStyle } from '../utils';
|
import { createNamespace, addUnit, getSizeStyle } from '../utils';
|
||||||
|
|
||||||
const [createComponent, bem] = createNamespace('skeleton');
|
const [createComponent, bem] = createNamespace('skeleton');
|
||||||
@ -26,7 +27,7 @@ export default createComponent({
|
|||||||
default: '32px',
|
default: '32px',
|
||||||
},
|
},
|
||||||
avatarShape: {
|
avatarShape: {
|
||||||
type: String,
|
type: String as PropType<'square' | 'round'>,
|
||||||
default: 'round',
|
default: 'round',
|
||||||
},
|
},
|
||||||
titleWidth: {
|
titleWidth: {
|
||||||
@ -34,7 +35,9 @@ export default createComponent({
|
|||||||
default: '40%',
|
default: '40%',
|
||||||
},
|
},
|
||||||
rowWidth: {
|
rowWidth: {
|
||||||
type: [Number, String, Array],
|
type: [Number, String, Array] as PropType<
|
||||||
|
number | string | (number | string)[]
|
||||||
|
>,
|
||||||
default: DEFAULT_ROW_WIDTH,
|
default: DEFAULT_ROW_WIDTH,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -62,7 +65,7 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getRowWidth = (index) => {
|
const getRowWidth = (index: number) => {
|
||||||
const { rowWidth } = props;
|
const { rowWidth } = props;
|
||||||
|
|
||||||
if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {
|
if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {
|
||||||
@ -77,7 +80,7 @@ export default createComponent({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderRows = () => {
|
const renderRows = () => {
|
||||||
const Rows = [];
|
const Rows: JSX.Element[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < props.row; i++) {
|
for (let i = 0; i < props.row; i++) {
|
||||||
Rows.push(
|
Rows.push(
|
Loading…
x
Reference in New Issue
Block a user