This commit is contained in:
cookfront 2017-03-22 10:49:34 +08:00
parent 7f6ac15fca
commit dd13bec2d2
4 changed files with 21 additions and 28 deletions

View File

@ -25,9 +25,6 @@ export default {
@import './assets/docs.css'; @import './assets/docs.css';
.page-container { .page-container {
height: 100%;
overflow: scroll;
section > h2 { section > h2 {
font-size: 36px; font-size: 36px;
color: #333; color: #333;
@ -65,9 +62,9 @@ export default {
.page-content { .page-content {
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
height: inherit;
margin-left: 220px; margin-left: 220px;
padding: 0 20px; padding: 0 20px;
border-left: 1px solid #E5E5E5;
section > p { section > p {
font-size: 14px; font-size: 14px;

View File

@ -18,16 +18,10 @@ time, mark, audio, video {
vertical-align: baseline; vertical-align: baseline;
} }
html {
height: 100%;
}
body { body {
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif; font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
overflow: hidden;
font-weight: 400; font-weight: 400;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
height: 100%;
} }
a { a {

View File

@ -50,12 +50,6 @@
type: String, type: String,
default: '' default: ''
} }
},
data() {
return {
highlights: [],
navState: []
};
} }
}; };
</script> </script>
@ -65,11 +59,8 @@
width: 220px; width: 220px;
box-sizing: border-box; box-sizing: border-box;
padding: 40px 20px; padding: 40px 20px;
border-right: 1px solid #E5E5E5;
float: left; float: left;
background-color: #fff; background-color: #fff;
height: inherit;
overflow: auto;
li { li {
list-style: none; list-style: none;

View File

@ -35,7 +35,9 @@ const router = new VueRouter({
}); });
router.beforeEach((route, redirect, next) => { router.beforeEach((route, redirect, next) => {
if (route.path !== '/') {
window.scrollTo(0, 0); window.scrollTo(0, 0);
}
if (isMobile()) { if (isMobile()) {
window.location.replace(location.pathname + 'examples.html#' + route.path); window.location.replace(location.pathname + 'examples.html#' + route.path);
return; return;
@ -44,6 +46,15 @@ router.beforeEach((route, redirect, next) => {
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 new Vue({ // eslint-disable-line
render: h => h(App), render: h => h(App),
router router