mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 14:39:16 +08:00
[Doc] add demo link (#1266)
This commit is contained in:
parent
409055195b
commit
963ee61a36
@ -6,7 +6,11 @@
|
|||||||
:title="title"
|
:title="title"
|
||||||
left-arrow
|
left-arrow
|
||||||
@click-left="onBack"
|
@click-left="onBack"
|
||||||
/>
|
>
|
||||||
|
<a slot="right" :href="demoLink" target="_blank">
|
||||||
|
<van-icon name="edit" />
|
||||||
|
</a>
|
||||||
|
</van-nav-bar>
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<router-view />
|
<router-view />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
@ -19,6 +23,10 @@ export default {
|
|||||||
title() {
|
title() {
|
||||||
const { name } = this.$route.meta;
|
const { name } = this.$route.meta;
|
||||||
return name ? name.replace(/-/g, '') : '';
|
return name ? name.replace(/-/g, '') : '';
|
||||||
|
},
|
||||||
|
|
||||||
|
demoLink() {
|
||||||
|
return `https://github.com/youzan/vant/blob/dev/packages/${this.$route.meta.path}/demo/index.vue`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -44,6 +52,19 @@ body {
|
|||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.van-nav-bar__left,
|
||||||
|
.van-nav-bar__right {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-nav-bar__right {
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
.van-icon {
|
||||||
|
vertical-align: -3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-doc-demo-section {
|
.van-doc-demo-section {
|
||||||
|
@ -59,6 +59,7 @@ const registerRoute = (isDemo) => {
|
|||||||
path: `/${lang}/${path}`,
|
path: `/${lang}/${path}`,
|
||||||
meta: {
|
meta: {
|
||||||
lang,
|
lang,
|
||||||
|
path,
|
||||||
name: page.title
|
name: page.title
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user