提交 be7a6e53 编写于 作者: Q qiang

feat: App、H5 节点信息支持返回 scrollHeight、scrollWidth

上级 5ddcc170
......@@ -27,8 +27,12 @@ function getRootInfo (fields) {
info.height = document.documentElement.clientHeight
}
if (fields.scrollOffset) {
info.scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft || 0
info.scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0
const documentElement = document.documentElement
const body = document.body
info.scrollLeft = documentElement.scrollLeft || body.scrollLeft || 0
info.scrollTop = documentElement.scrollTop || body.scrollTop || 0
info.scrollHeight = documentElement.scrollHeight || body.scrollHeight || 0
info.scrollWidth = documentElement.scrollWidth || body.scrollWidth || 0
}
return info
}
......
......@@ -511,7 +511,9 @@ export default {
const main = this.$refs.main
return {
scrollLeft: main.scrollLeft,
scrollTop: main.scrollTop
scrollTop: main.scrollTop,
scrollHeight: main.scrollHeight,
scrollWidth: main.scrollWidth
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册