feat(cli): DemoBlock add card style (#6702)

This commit is contained in:
neverland 2020-07-04 17:46:17 +08:00 committed by GitHub
parent f731b38cc7
commit 4aff784d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,10 @@
<template> <template>
<div class="van-doc-demo-block"> <div class="van-doc-demo-block">
<h2 class="van-doc-demo-block__title">{{ title }}</h2> <h2 class="van-doc-demo-block__title">{{ title }}</h2>
<slot /> <div v-if="card" class="van-doc-demo-block__card">
<slot />
</div>
<slot v-else />
</div> </div>
</template> </template>
@ -10,6 +13,7 @@ export default {
name: 'demo-block', name: 'demo-block',
props: { props: {
card: Boolean,
title: String, title: String,
}, },
}; };
@ -28,6 +32,12 @@ export default {
line-height: 16px; line-height: 16px;
} }
&__card {
margin: 0 12px 0;
overflow: hidden;
border-radius: 8px;
}
&:first-of-type { &:first-of-type {
.van-doc-demo-block__title { .van-doc-demo-block__title {
padding-top: 20px; padding-top: 20px;