mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix docs
This commit is contained in:
parent
7f6ac15fca
commit
dd13bec2d2
@ -25,9 +25,6 @@ export default {
|
||||
@import './assets/docs.css';
|
||||
|
||||
.page-container {
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
|
||||
section > h2 {
|
||||
font-size: 36px;
|
||||
color: #333;
|
||||
@ -65,9 +62,9 @@ export default {
|
||||
.page-content {
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
height: inherit;
|
||||
margin-left: 220px;
|
||||
padding: 0 20px;
|
||||
border-left: 1px solid #E5E5E5;
|
||||
|
||||
section > p {
|
||||
font-size: 14px;
|
||||
|
@ -18,16 +18,10 @@ time, mark, audio, video {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
|
||||
overflow: hidden;
|
||||
font-weight: 400;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -43,21 +43,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
data: Array,
|
||||
base: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
highlights: [],
|
||||
navState: []
|
||||
};
|
||||
export default {
|
||||
props: {
|
||||
data: Array,
|
||||
base: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
@ -65,11 +59,8 @@
|
||||
width: 220px;
|
||||
box-sizing: border-box;
|
||||
padding: 40px 20px;
|
||||
border-right: 1px solid #E5E5E5;
|
||||
float: left;
|
||||
background-color: #fff;
|
||||
height: inherit;
|
||||
overflow: auto;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
|
@ -35,7 +35,9 @@ const router = new VueRouter({
|
||||
});
|
||||
|
||||
router.beforeEach((route, redirect, next) => {
|
||||
window.scrollTo(0, 0);
|
||||
if (route.path !== '/') {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
if (isMobile()) {
|
||||
window.location.replace(location.pathname + 'examples.html#' + route.path);
|
||||
return;
|
||||
@ -44,6 +46,15 @@ router.beforeEach((route, redirect, next) => {
|
||||
next();
|
||||
});
|
||||
|
||||
router.afterEach((route) => {
|
||||
if (route.page !== '/') {
|
||||
const sideNavHeight = document.querySelector('.side-nav').clientHeight;
|
||||
const pageContentBox = document.querySelector('.page-content');
|
||||
const pageContentHeight = pageContentBox.clientHeight;
|
||||
pageContentBox.style.height = Math.max(sideNavHeight, pageContentHeight) + 'px';
|
||||
}
|
||||
});
|
||||
|
||||
new Vue({ // eslint-disable-line
|
||||
render: h => h(App),
|
||||
router
|
||||
|
Loading…
x
Reference in New Issue
Block a user