Popover

Popover。

使用

  1. <div style="position:relative;left:100px;top:100px;">
  2. <m-button id='myBtn'>top-left</m-button>
  3. </div>
  4. <m-popover id="myPopover" target="#myBtn">
  5. <div>Test Content</div>
  6. <div>Test Content</div>
  7. <div>Test Content..</div>
  8. </m-popover>
  9. <script>
  10. var myPopover = document.querySelector('#myPopover')
  11. var myBtn = document.querySelector('#myBtn')
  12. myBtn.addEventListener('click', function () {
  13. myPopover.pureSetAttribute('direction', 'top-left')
  14. myPopover.setAttribute('show', '')
  15. })
  16. </script>

API

Props

  1. {
  2. show: boolean;
  3. x: number,
  4. y: number,
  5. direction: string,
  6. target: string | HTMLElement
  7. }