mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(cli): auto wrap demo-section
This commit is contained in:
parent
fd915d1cff
commit
862c3ec1a4
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<demo-nav />
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<demo-nav />
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<demo-section>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</div>
|
||||
</demo-section>
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user