更新:1.课程详情增加骨架屏;2.图书首页和图书详情增加骨架屏;
This commit is contained in:
15
components/Skeleton/templates/BookCard.vue
Normal file
15
components/Skeleton/templates/BookCard.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<view>
|
||||
<wd-skeleton :row-col="info" animation="gradient" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const count = 10
|
||||
const info = Array.from({ length: count }, (_, index) => ({ height: '20px' }))
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
31
components/Skeleton/templates/BookInfo.vue
Normal file
31
components/Skeleton/templates/BookInfo.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<view>
|
||||
<wd-skeleton :row-col="info" animation="gradient" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const info = [
|
||||
{ width: '300rpx', height: '400rpx' },
|
||||
{ width: '600rpx', height: '60rpx' },
|
||||
{ width: '180rpx', height: '40rpx' },
|
||||
[{ width: '180rpx', height: '120rpx' }, { width: '180rpx', height: '120rpx' }, { width: '180rpx', height: '120rpx' }],
|
||||
{ width: '700rpx', height: '40rpx' },
|
||||
{ width: '700rpx', height: '40rpx' },
|
||||
{ width: '700rpx', height: '40rpx' },
|
||||
{ width: '700rpx', height: '40rpx' }
|
||||
]
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.wd-skeleton__content) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.wd-skeleton__row {
|
||||
gap: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
16
components/Skeleton/templates/ImageCard.vue
Normal file
16
components/Skeleton/templates/ImageCard.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<view>
|
||||
<wd-skeleton theme="image" :row-col="list" animation="gradient" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps<{
|
||||
size?: any[],
|
||||
count: number
|
||||
}>()
|
||||
const list = Array.from({ length: props.count }, (_, index) => (props.size || []))
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
17
components/Skeleton/templates/ImageText.vue
Normal file
17
components/Skeleton/templates/ImageText.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<view>
|
||||
<wd-skeleton :row-col="info" animation="gradient" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const info = [
|
||||
{ height: '220px' }, 1, 1,
|
||||
[{ width: '93px' }]
|
||||
]
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
15
components/Skeleton/templates/LineList.vue
Normal file
15
components/Skeleton/templates/LineList.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<view>
|
||||
<wd-skeleton :row-col="info" animation="gradient" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const count = 10
|
||||
const info = Array.from({ length: count }, (_, index) => ({ height: '20px' }))
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user