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"
|
||||
left-arrow
|
||||
@click-left="onBack"
|
||||
/>
|
||||
>
|
||||
<a slot="right" :href="demoLink" target="_blank">
|
||||
<van-icon name="edit" />
|
||||
</a>
|
||||
</van-nav-bar>
|
||||
<keep-alive>
|
||||
<router-view />
|
||||
</keep-alive>
|
||||
@ -19,6 +23,10 @@ export default {
|
||||
title() {
|
||||
const { name } = this.$route.meta;
|
||||
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;
|
||||
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 {
|
||||
|
@ -59,6 +59,7 @@ const registerRoute = (isDemo) => {
|
||||
path: `/${lang}/${path}`,
|
||||
meta: {
|
||||
lang,
|
||||
path,
|
||||
name: page.title
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user