chore(cli): auto wrap demo-section

This commit is contained in:
chenjiahan 2020-10-22 16:28:34 +08:00
parent fd915d1cff
commit 862c3ec1a4
2 changed files with 8 additions and 21 deletions

View File

@ -1,12 +1,12 @@
<template>
<div>
<demo-nav />
<router-view v-slot="{ Component }">
<keep-alive>
<demo-section>
<component :is="Component" />
</demo-section>
</keep-alive>
</router-view>
</div>
</template>
<script>

View File

@ -1,5 +1,5 @@
<template>
<div class="van-doc-demo-block" :class="demoName">
<div class="van-doc-demo-block">
<h2 v-if="title" class="van-doc-demo-block__title">{{ title }}</h2>
<div v-if="card" class="van-doc-demo-block__card">
<slot />
@ -9,8 +9,6 @@
</template>
<script>
import { decamelize } from '../../common';
export default {
name: 'demo-block',
@ -18,17 +16,6 @@ export default {
card: Boolean,
title: String,
},
computed: {
demoName() {
const { meta } = this.$route || {};
if (meta && meta.name) {
return `demo-${decamelize(meta.name)}`;
}
return '';
},
},
};
</script>