| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <script setup lang="ts">
- import Text from '../basic/Text.vue';
- import DemoTitle from './DemoTitle.vue';
- defineProps({
- title: String,
- desc: String,
- flat: Boolean,
- smallTitle: Boolean,
- })
- </script>
- <template>
- <view :class="['nana-demo-block',flat?'flat':'']">
- <view class="header">
- <DemoTitle v-if="title" :title="title" :desc="desc" :small="smallTitle" />
- <Text v-if="desc" color="text.second" :text="desc" />
- </view>
- <slot />
- </view>
- </template>
- <style>
- .nana-demo-block {
- position: relative;
- display: flex;
- flex-direction: column;
- margin: 0 40rpx 40rpx 40rpx;
- }
- .nana-demo-block.flat {
- padding: 0;
- margin: 0;
- margin-bottom: 40rpx;
- background-color: transparent;
- }
- .nana-demo-block.flat .header {
- margin: 0 40rpx 20rpx 40rpx;
- }
- .nana-demo-block .header {
- margin: 0 0 20rpx 0;
- }
- </style>
|