mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: resolve osInstance is null in haveScrollbar() (#1306)
Co-authored-by: EkkoLee98 <ekkoli@addcn.com>
This commit is contained in:
@@ -264,9 +264,12 @@ function openIframeDrawer(url: string) {
|
||||
async function haveScrollbar() {
|
||||
await nextTick()
|
||||
const osInstance = scrollbarRef.value?.osInstance()
|
||||
const { viewport } = osInstance.elements()
|
||||
const { scrollHeight } = viewport // get scroll offset
|
||||
return scrollHeight > window.innerHeight
|
||||
// If the scrollbarRef is not ready, return false
|
||||
if (osInstance) {
|
||||
const { viewport } = osInstance.elements()
|
||||
const { scrollHeight } = viewport // get scroll offset
|
||||
return scrollHeight > window.innerHeight
|
||||
}
|
||||
}
|
||||
|
||||
// In drawer video, watch btn className changed and post message to parent
|
||||
|
||||
Reference in New Issue
Block a user