Files
uni/packages/card/index.vue
2023-07-11 04:07:23 +08:00

29 lines
767 B
Vue

<!--
* @Author: peerless_hero peerless_hero@outlook.com
* @Date: 2023-07-08 01:36:19
* @LastEditors: peerless_hero peerless_hero@outlook.com
* @LastEditTime: 2023-07-11 04:06:41
* @FilePath: \uni\packages\card\index.vue
* @Description:
*
-->
<template>
<View class="th-card" bg-white rounded-16rpx m-24rpx max-w-702rpx overflow-hidden>
<slot />
<View v-if="noCardActions" h-16rpx />
</View>
</template>
<script lang="ts" setup name="Card">
/** 不存在操作栏组件时,自动增加底部的内边距 */
const noCardActions = useSlots().default().every(({ type }) =>
typeof type !== 'object' || !('name' in type) || type.name !== 'CardActions',
)
</script>
<style lang="scss">
.th-card {
box-shadow: 0px 1px 6px 0px #d8d8d880;
}
</style>