feat(cli): support more features

This commit is contained in:
陈嘉涵
2019-11-21 14:43:25 +08:00
parent b61f331f7a
commit abe15a63fc
16 changed files with 1112 additions and 139 deletions
@@ -1,8 +1,8 @@
<template>
<section class="van-doc-demo-block">
<div class="van-doc-demo-block">
<h2 class="van-doc-demo-block__title">{{ title }}</h2>
<slot />
</section>
</div>
</template>
<script>
@@ -1,7 +1,7 @@
<template>
<div v-show="title" class="van-doc-demo-nav">
<div class="van-doc-demo-nav__title">{{ title }}</div>
<svg class="van-doc-demo-nav__back" viewBox="0 0 1000 1000" @click="onBack">
<div v-show="title" class="demo-nav">
<div class="demo-nav__title">{{ title }}</div>
<svg class="demo-nav__back" viewBox="0 0 1000 1000" @click="onBack">
<path fill="#969799" fill-rule="evenodd" :d="path" />
</svg>
</div>
@@ -19,7 +19,8 @@ export default {
computed: {
title() {
const { name } = this.$route.meta || {};
const route = this.$route || {};
const { name } = route.meta || {};
return name ? name.replace(/-/g, '') : '';
}
},
@@ -33,7 +34,7 @@ export default {
</script>
<style lang="less">
.van-doc-demo-nav {
.demo-nav {
position: relative;
height: 56px;
line-height: 56px;
@@ -12,7 +12,7 @@ export default {
computed: {
demoName() {
const { meta } = this.$route;
const { meta } = this.$route || {};
if (meta && meta.name) {
return `demo-${decamelize(meta.name, '-')}`;
}