Carbon: fix scrollbar style in safari & ff

pull/7390/head
wayne 2017-10-09 10:42:42 +08:00 committed by 杨奕
parent 8ad7dda6c5
commit 5069718c4f
3 changed files with 13 additions and 9 deletions

View File

@ -7,7 +7,13 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%; height: 100%;
overflow-y: hidden; font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
font-weight: 400;
-webkit-font-smoothing: antialiased;
&.is-component {
overflow: hidden;
}
} }
#app { #app {
@ -22,6 +28,7 @@
height: 100%; height: 100%;
min-height: auto; min-height: auto;
} }
.headerWrapper { .headerWrapper {
position: fixed; position: fixed;
width: 100%; width: 100%;
@ -36,13 +43,6 @@
} }
} }
body {
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
overflow: auto;
font-weight: 400;
-webkit-font-smoothing: antialiased;
}
a { a {
color: #409EFF; color: #409EFF;
text-decoration: none; text-decoration: none;

View File

@ -476,7 +476,7 @@
mounted() { mounted() {
function scroll(fn) { function scroll(fn) {
document.body.addEventListener('scroll', fn, false); window.addEventListener('scroll', fn, false);
} }
scroll(() => { scroll(() => {
if (this.isHome) { if (this.isHome) {

View File

@ -241,6 +241,10 @@
this.componentScrollBox = this.componentScrollBar.$el.querySelector('.el-scrollbar__wrap'); this.componentScrollBox = this.componentScrollBar.$el.querySelector('.el-scrollbar__wrap');
this.throttledScrollHandler = throttle(300, this.handleScroll); this.throttledScrollHandler = throttle(300, this.handleScroll);
this.componentScrollBox.addEventListener('scroll', this.throttledScrollHandler); this.componentScrollBox.addEventListener('scroll', this.throttledScrollHandler);
document.body.classList.add('is-component');
},
destroyed() {
document.body.classList.remove('is-component');
}, },
beforeDestroy() { beforeDestroy() {
this.componentScrollBox.removeEventListener('scroll', this.throttledScrollHandler); this.componentScrollBox.removeEventListener('scroll', this.throttledScrollHandler);