mirror of https://github.com/ElemeFE/element
improve header background (#1416)
parent
84efedcc71
commit
0373211131
|
@ -227,9 +227,12 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.path'() {
|
'$route.path': {
|
||||||
this.isHome = /^home/.test(this.$route.name);
|
immediate: true,
|
||||||
this.headerStyle.backgroundColor = `rgba(32, 160, 255, ${ this.isHome ? '0' : '1' })`;
|
handler() {
|
||||||
|
this.isHome = /^home/.test(this.$route.name);
|
||||||
|
this.headerStyle.backgroundColor = `rgba(32, 160, 255, ${ this.isHome ? '0' : '1' })`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -248,7 +251,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.isHome = this.$route.name === 'home';
|
|
||||||
function scroll(fn) {
|
function scroll(fn) {
|
||||||
window.addEventListener('scroll', () => {
|
window.addEventListener('scroll', () => {
|
||||||
fn();
|
fn();
|
||||||
|
|
Loading…
Reference in New Issue