chore: add vant-doc package (#4197)

This commit is contained in:
neverland
2019-08-22 20:11:09 +08:00
committed by GitHub
parent f3f3789011
commit eeb65ed922
24 changed files with 1395 additions and 108 deletions

View File

@@ -0,0 +1,62 @@
<template>
<section class="van-doc-demo-section" :class="`demo-${demoName}`" :style="style">
<slot />
</section>
</template>
<script>
export default {
name: 'van-doc-demo-section',
props: {
name: String,
title: String,
background: String
},
computed: {
demoName() {
return this.name || this.getParentName();
},
style() {
return {
background: this.background
};
}
},
methods: {
getParentName() {
const { $parent } = this;
if ($parent && $parent.$options.name) {
return $parent.$options.name.replace('demo-', '');
}
}
}
};
</script>
<style lang="less">
@import '../style/variable';
.van-doc-demo-section {
box-sizing: border-box;
min-height: 100vh;
padding-bottom: 20px;
&__title {
margin: 0;
padding: 15px;
font-weight: normal;
font-size: 16px;
line-height: 1.5;
text-transform: capitalize;
+ .van-doc-demo-block {
.van-doc-demo-block__title {
padding-top: 0;
}
}
}
}
</style>