Socket
Socket
Sign inDemoInstall

@beisen-cmps/common-mount

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @beisen-cmps/common-mount

平台通用挂载组件


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
2.26 MB
Created
Weekly downloads
 

Readme

Source

CommonMount

挂载公共方法

  • 组件构造函数中创建挂载容器

示例:

this.commonMount = new commonMount({
  containerId: 'AutoComplete_ul', // 容器ID
  follow: true, // 是否滚动跟随,默认true
  fixed: true // 定位:fixed,false时为absolute
});

  • 在需要挂载的时候传入挂载参数,RenderDOM

需要预先计算出挂载高度并传入

示例:

this.commonMount.renderDom(
  'auto-complete-wrap', // wrap's classname/id-name
  showAutoUl, // content dom
  this.refs.autoInput, // 滚动跟随节点
  [
    this.tar, //挂载节点
    { // 挂载元素宽高 {width: '', height: ''}
      width: autoResult && autoResult.offsetwidth,
      height: autoResultHeight
    }
  ],
  false,  //isInput,挂载节点为input
  140, //向左水平偏移的距离,为负 -140 则为向右偏移
  true //弹层靠左靠右模式,默认为false 靠左模式
);
  • 关闭的时候可以卸载节点并取消事件监听

示例:

this.commonMount.unmountBox();

Keywords

FAQs

Last updated on 28 Sep 2018

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