mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 09:52:57 +08:00
[Doc] support hide demo nav (#2156)
This commit is contained in:
parent
1e68b62562
commit
ae49bdc89d
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<van-nav-bar
|
<van-nav-bar
|
||||||
v-show="title"
|
v-show="title && showNav"
|
||||||
class="van-doc-nav-bar"
|
class="van-doc-nav-bar"
|
||||||
:title="title"
|
:title="title"
|
||||||
left-arrow
|
left-arrow
|
||||||
@ -22,6 +22,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
function getQueryString(name) {
|
||||||
|
const arr = location.search.substr(1).split('&');
|
||||||
|
for (let i = 0, l = arr.length; i < l; i++) {
|
||||||
|
const item = arr[i].split('=');
|
||||||
|
if (item.shift() === name) {
|
||||||
|
return decodeURIComponent(item.join('='));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
@ -30,7 +41,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
demoLink() {
|
demoLink() {
|
||||||
return `https://github.com/youzan/vant/blob/dev/packages/${this.$route.meta.path}/demo/index.vue`;
|
return `https://github.com/youzan/vant/blob/dev/packages/${
|
||||||
|
this.$route.meta.path
|
||||||
|
}/demo/index.vue`;
|
||||||
|
},
|
||||||
|
|
||||||
|
showNav() {
|
||||||
|
return getQueryString('hide_nav') !== '1';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user