mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Sekelton): row can be string
This commit is contained in:
parent
ad6087770d
commit
7b6022d0e7
@ -55,12 +55,12 @@ export default {
|
|||||||
|
|
||||||
| Attribute | Description | Type | Default |
|
| Attribute | Description | Type | Default |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| row | Row count | *number* | `0` |
|
| row | Row count | *number \| string* | `0` |
|
||||||
| row-width | Row width, can be array | *number \| number \| string[] \| string[]* | `100%` |
|
| row-width | Row width, can be array | *number \| string \|<br>(number \| string)[]* | `100%` |
|
||||||
| title | Whether to show title placeholder | *boolean* | `false` |
|
| title | Whether to show title placeholder | *boolean* | `false` |
|
||||||
| title-width | Title width | *number \| string* | `40%` |
|
|
||||||
| avatar | Whether to show avatar placeholder | *boolean* | `false` |
|
| avatar | Whether to show avatar placeholder | *boolean* | `false` |
|
||||||
| avatar-size | Size of avatar placeholder | *number \| string* | `32px` |
|
|
||||||
| avatar-shape | Shape of avatar placeholder,can be set to `square` | *string* | `round` |
|
|
||||||
| loading | Whether to show skeleton,pass `false` to show child component | *boolean* | `true` |
|
| loading | Whether to show skeleton,pass `false` to show child component | *boolean* | `true` |
|
||||||
| animate | Whether to enable animation | *boolean* | `true` |
|
| animate | Whether to enable animation | *boolean* | `true` |
|
||||||
|
| title-width | Title width | *number \| string* | `40%` |
|
||||||
|
| avatar-size | Size of avatar placeholder | *number \| string* | `32px` |
|
||||||
|
| avatar-shape | Shape of avatar placeholder,can be set to `square` | *string* | `round` |
|
||||||
|
@ -61,12 +61,12 @@ export default {
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| row | 段落占位图行数 | *number* | `0` |
|
| row | 段落占位图行数 | *number \| string* | `0` |
|
||||||
| row-width | 段落占位图宽度,可传数组来设置每一行的宽度 | *number \| number \| string[] \| string[]* | `100%` |
|
| row-width | 段落占位图宽度,可传数组来设置每一行的宽度 | *number \| string \|<br>(number \| string)[]* | `100%` |
|
||||||
| title | 是否显示标题占位图 | *boolean* | `false` |
|
| title | 是否显示标题占位图 | *boolean* | `false` |
|
||||||
| title-width | 标题占位图宽度 | *number \| string* | `40%` |
|
|
||||||
| avatar | 是否显示头像占位图 | *boolean* | `false` |
|
| avatar | 是否显示头像占位图 | *boolean* | `false` |
|
||||||
|
| loading | 是否显示骨架屏,传`false`时会展示子组件内容 | *boolean* | `true` |
|
||||||
|
| animate | 是否开启动画 | *boolean* | `true` |
|
||||||
|
| title-width | 标题占位图宽度 | *number \| string* | `40%` |
|
||||||
| avatar-size | 头像占位图大小 | *number \| string* | `32px` |
|
| avatar-size | 头像占位图大小 | *number \| string* | `32px` |
|
||||||
| avatar-shape | 头像占位图形状,可选值为`square` | *string* | `round` |
|
| avatar-shape | 头像占位图形状,可选值为`square` | *string* | `round` |
|
||||||
| loading | 是否显示占位图,传`false`时会展示子组件内容 | *boolean* | `true` |
|
|
||||||
| animate | 是否开启动画 | *boolean* | `true` |
|
|
||||||
|
@ -7,7 +7,7 @@ import { CreateElement, RenderContext } from 'vue/types';
|
|||||||
import { DefaultSlots } from '../utils/types';
|
import { DefaultSlots } from '../utils/types';
|
||||||
|
|
||||||
export type SkeletonProps = {
|
export type SkeletonProps = {
|
||||||
row: number;
|
row: number | string;
|
||||||
title?: boolean;
|
title?: boolean;
|
||||||
avatar?: boolean;
|
avatar?: boolean;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
@ -45,7 +45,7 @@ function Skeleton(
|
|||||||
const { rowWidth } = props;
|
const { rowWidth } = props;
|
||||||
|
|
||||||
function getRowWidth(index: number) {
|
function getRowWidth(index: number) {
|
||||||
if (rowWidth === DEFAULT_ROW_WIDTH && index === props.row - 1) {
|
if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {
|
||||||
return DEFAULT_LAST_ROW_WIDTH;
|
return DEFAULT_LAST_ROW_WIDTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ Skeleton.props = {
|
|||||||
title: Boolean,
|
title: Boolean,
|
||||||
avatar: Boolean,
|
avatar: Boolean,
|
||||||
row: {
|
row: {
|
||||||
type: Number,
|
type: [Number, String],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
loading: {
|
loading: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user