File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
3
<VueFixedHeader
4
+ @change =" updateFixedStatus"
4
5
:threshold =" propsData.threshold"
5
6
:headerClass =" propsData.headerClass"
6
7
:fixedClass =" propsData.fixedClass"
49
50
<footer >
50
51
<el-menu class =" footer-content" >
51
52
<div class =" flex-1" ></div >
53
+ <el-menu-item class =" fixed-footer__item" index =" 1" >
54
+ <b > isFixed: {{ fixedStatus.headerIsFixed }} </b >
55
+ </el-menu-item >
52
56
<el-menu-item class =" fixed-footer__item" index =" 1" >
53
57
<b > threshold: {{ propsData.threshold }} </b >
54
58
</el-menu-item >
@@ -80,11 +84,17 @@ export default Vue.extend({
80
84
},
81
85
data() {
82
86
return {
87
+ fixedStatus: {
88
+ headerIsFixed: false
89
+ },
83
90
propsData: { ... createData () },
84
91
formData: { ... createData () }
85
92
}
86
93
},
87
94
methods: {
95
+ updateFixedStatus(next : boolean ) {
96
+ this .fixedStatus .headerIsFixed = next
97
+ },
88
98
handleClickUpdate() {
89
99
this .propsData = { ... this .formData }
90
100
},
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export default Vue.extend({
48
48
const { tag, qs, threshold } = this
49
49
if ( tag && this . isFixed !== qs ( tag ) . scrollTop > threshold ) {
50
50
this . isFixed = qs ( tag ) . scrollTop > threshold
51
+ this . $emit ( 'change' , this . isFixed )
51
52
this . $forceUpdate ( )
52
53
}
53
54
}
You can’t perform that action at this time.
0 commit comments