Socket
Socket
Sign inDemoInstall

@antv/dom-util

Package Overview
Dependencies
1
Maintainers
57
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @antv/dom-util

A common util collection for antv projects


Version published
Weekly downloads
125K
decreased by-0.96%
Maintainers
57
Install size
75.7 kB
Created
Weekly downloads
 

Readme

Source

dom-util

antv 开发的轻量级工具方法库。

安装下载

tnpm i --save @antv/util

// 所有的 api 是都这么引入,名字不同而已
import { createDom, getStyle } from '@antv/dom-util';

const dom = createDom('<div></div>').appendTo(document.body);

API 文档

目前使用到的、且推荐使用的 API 文档,不在文档内的不建议使用。

  • createDom(string) HTMLElement 创建 dom 对象,支持复杂字符串
  • addEventListener(dom, callback) Object 添加事件
const handler = addEventListener(dom, function(ev) {

});
handler.remove();
  • getHeight(dom) Number
  • getWidth(dom) Number
  • getOuterHeight(dom) Number
  • getOuterWidth(dom) Number
  • getRatio() Number 获取屏幕像素比
  • getStyle(styleName) 获取样式
  • modifyCss(obj) 修改样式

Keywords

FAQs

Last updated on 25 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc