Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/dom-util

Package Overview
Dependencies
Maintainers
57
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/dom-util

A common util collection for antv projects

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132K
increased by6.57%
Maintainers
57
Weekly downloads
 
Created
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

Package last updated on 25 Jan 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc