更新:课程首页增加骨架屏
This commit is contained in:
@@ -19,6 +19,9 @@ import LineList from './templates/LineList.vue'
|
||||
import BookCard from './templates/BookCard.vue'
|
||||
import ImageCard from './templates/ImageCard.vue'
|
||||
import BookInfo from './templates/BookInfo.vue'
|
||||
import Menu from './templates/Menu.vue'
|
||||
|
||||
|
||||
|
||||
// 注册组件
|
||||
const components = {
|
||||
@@ -28,6 +31,7 @@ const components = {
|
||||
'image-card': ImageCard,
|
||||
'book-card': BookCard,
|
||||
'book-info': BookInfo,
|
||||
'menu': Menu
|
||||
}
|
||||
|
||||
type RequestFn = () => Promise<any>
|
||||
|
||||
33
components/Skeleton/templates/Menu.vue
Normal file
33
components/Skeleton/templates/Menu.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view class="menu-box">
|
||||
<wd-skeleton :row-col="grid" 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 || []))
|
||||
|
||||
const grid = [
|
||||
[
|
||||
{ width: '96rpx', height: '96rpx' },
|
||||
{ width: '96rpx', height: '96rpx' },
|
||||
{ width: '96rpx', height: '96rpx' },
|
||||
{ width: '96rpx', height: '96rpx' }
|
||||
]
|
||||
]
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.menu-box {
|
||||
padding: 40rpx 80rpx;
|
||||
background-color: #f5f5f5;
|
||||
|
||||
:deep(.wd-skeleton) {
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user