mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
feat: add DemoHome components
This commit is contained in:
78
packages/vant-cli/site/mobile/components/DemoHome.vue
Normal file
78
packages/vant-cli/site/mobile/components/DemoHome.vue
Normal file
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<div class="demo-home">
|
||||
<h1 class="demo-home__title">
|
||||
<img :src="config.logo">
|
||||
<span>{{ config.title }}</span>
|
||||
</h1>
|
||||
<h2 v-if="config.description" class="demo-home__desc">{{ config.description }}</h2>
|
||||
<template v-for="(group, index) in config.nav">
|
||||
<demo-home-nav
|
||||
:group="group"
|
||||
:base="$vantLang"
|
||||
:key="index"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { config } from '../../../dist/mobile-config';
|
||||
import DemoHomeNav from './DemoHomeNav';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DemoHomeNav
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
config
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import '../../common/style/index';
|
||||
|
||||
.demo-home {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
padding: 46px 20px 20px;
|
||||
background: #fff;
|
||||
|
||||
&__title,
|
||||
&__desc {
|
||||
padding-left: 16px;
|
||||
font-weight: normal;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 0 0 16px;
|
||||
|
||||
img,
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
span {
|
||||
margin-left: 16px;
|
||||
font-weight: 500;
|
||||
font-size: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
&__desc {
|
||||
margin: 0 0 40px;
|
||||
color: #7d7e80;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user