# height
获取元素节点高度的像素数
import { height } from '@hui-pro/utils';
height(node, type);
TIP
想同时获取 width、height 可使用 import { size } from '@hui-pro/utils'; 将以 object 类型返回 { width: 0, height: 0 }
# API
参数 | 说明 | 类型 | 默认值 | 可选值 |
---|---|---|---|---|
node | DOM 元素节点 | Element | - | - |
type 可选 | 获取的类型。为空 :content---等同于 jq:$.height()inner :content + padding---等同于 jq:$.innerHeight()outer :content + padding + border---等同于 jq:$.outerHeight()box :content + padding + border + margin---等同于 jq:$.outerHeight(true)scroll :滚动长度 | String | - | 'inner','outer','box','scroll' |