返回顶部的方法

Former-commit-id: 3c95b5a5df8c09efda44212256f5063a37f9fbc8 [formerly 3c95b5a5df8c09efda44212256f5063a37f9fbc8 [formerly 3c95b5a5df8c09efda44212256f5063a37f9fbc8 [formerly 3c95b5a5df8c09efda44212256f5063a37f9fbc8 [formerly 7765bde19a0f24f058d187abf04a543de1a701e3 [formerly 6da35f0374891df1c2cf2e27562a1890f68b4045]]]]]
Former-commit-id: d76ca39daa8f2e97e23eada1bbe5f6ee6deb8459
Former-commit-id: 8a0e5b235398aa2bcd4bc313b194ecda4b3ca70c
Former-commit-id: debdb63291e7831e910962793e92a5982eda5262 [formerly ac58f2e8ad837ca633adff21751b90404d948b67]
Former-commit-id: 74b92416979407e855119f8f20e54dc635f186e3
Former-commit-id: 4f943668a9e8989426d1de2bed7c27a875ef7752
Former-commit-id: 06ee2b7121ca1bfea625f2e95dc43f19a7b4987f
Former-commit-id: 8125182559664ee6704d72ac9073eae009eb2e75
Former-commit-id: 39b9b54e3d6e39fafc85f397b8c50d51113173e0
This commit is contained in:
liyang
2018-11-16 10:25:08 +08:00
parent b45ef7a442
commit 93b718bd12
3 changed files with 29 additions and 7 deletions

View File

@@ -48,6 +48,7 @@ export default {
class: 'container-component'
}, [
h(this.component, {
ref: 'component',
props: this.$attrs,
on: {
scroll: e => this.$emit('scroll', e)
@@ -58,5 +59,11 @@ export default {
props: this.$attrs
}) : undefined
])
},
methods: {
// 返回顶部
scrollToTop () {
this.$refs.component.scrollToTop()
}
}
}