mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [backtop] change default visible (#13069)
* fix(components): [backtop] change default visible * fix(components): [backtop] handleScroll onMounted & add unit test
This commit is contained in:
@@ -37,4 +37,12 @@ describe('Backtop.vue', () => {
|
||||
await wrapper.trigger('click')
|
||||
expect(wrapper.emitted()).toBeDefined()
|
||||
})
|
||||
test('render when visibilityHeight is zero', async () => {
|
||||
const wrapper = _mount(() => (
|
||||
<Backtop visibilityHeight={0} right={100} bottom={200} />
|
||||
))
|
||||
await nextTick()
|
||||
|
||||
expect(wrapper.find('.el-backtop').exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -36,6 +36,8 @@ export const useBackTop = (
|
||||
}
|
||||
container.value = el.value
|
||||
}
|
||||
// Give visible an initial value, fix #13066
|
||||
handleScroll()
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user