Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
perf[Sticky]: export reset method
  • Loading branch information
PanJiaChen committed Jan 24, 2019
commit ae502c6d18a83e1b3ed5659b0be9025b275372ba
7 changes: 5 additions & 2 deletions src/components/Sticky/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ export default {
this.width = this.width + 'px'
this.isSticky = true
},
reset() {
handleReset() {
if (!this.active) {
return
}
this.reset()
},
reset() {
this.position = ''
this.width = 'auto'
this.active = false
Expand All @@ -72,7 +75,7 @@ export default {
this.sticky()
return
}
this.reset()
this.handleReset()
},
handleReize() {
if (this.isSticky) {
Expand Down