代码拉取完成,页面将自动刷新
import _getElementSizes from './_getElementSizes'
import innerHeight from './innerHeight'
import innerWidth from './innerWidth'
import outerHeight from './outerHeight'
import outerWidth from './outerWidth'
/**
* 获取 DOM 节点的相关尺寸信息,返回相关尺寸数据的对象。
* ========================================================================
* @method sizes
* @param {HTMLElement} el
* @return {Object|Boolean}
*/
const sizes = (el) => {
const elSizes = _getElementSizes(el)
if (!elSizes) {
return false
}
return {
offsetHeight: elSizes.offsetHeight,
offsetWidth: elSizes.offsetWidth,
innerHeight: innerHeight(el),
innerWidth: innerWidth(el),
outerHeight: outerHeight(el),
outerWidth: outerWidth(el),
margin: {
top: elSizes.marginTop,
right: elSizes.marginRight,
bottom: elSizes.marginBottom,
left: elSizes.marginLeft
},
border: {
top: elSizes.borderTop,
right: elSizes.borderRight,
bottom: elSizes.borderBottom,
left: elSizes.borderLeft
},
padding: {
top: elSizes.paddingTop,
right: elSizes.paddingRight,
bottom: elSizes.paddingBottom,
left: elSizes.paddingLeft
},
rect: elSizes.rect
}
}
export default sizes
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。