气泡层 Popper

基本

  1. <za-cell class="direction-demo">
  2. <div>
  3. <div style="marginLeft: 60px">
  4. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="topLeft" content="topLeft text">
  5. <za-button ghost size="xs">TL</za-button>
  6. </za-popper>
  7. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="top" content="top text">
  8. <za-button ghost size="xs">Top</za-button>
  9. </za-popper>
  10. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="topRight" content="topRight text">
  11. <za-button ghost size="xs">TR</za-button>
  12. </za-popper>
  13. </div>
  14. <div style="width: 60px;float: left;clear: both">
  15. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="leftTop" content="leftTop text">
  16. <za-button ghost size="xs">LT</za-button>
  17. </za-popper>
  18. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="left" content="left text">
  19. <za-button ghost size="xs">Left</za-button>
  20. </za-popper>
  21. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="leftBottom" content="leftBottom text">
  22. <za-button ghost size="xs">LB</za-button>
  23. </za-popper>
  24. </div>
  25. <div style="width: 60px;marginLeft: 260px;">
  26. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="rightTop" content="rightTop text">
  27. <za-button ghost size="xs">RT</za-button>
  28. </za-popper>
  29. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="right" content="right text">
  30. <za-button ghost size="xs">Right</za-button>
  31. </za-popper>
  32. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="rightBottom" content="rightBottom text">
  33. <za-button ghost size="xs">RB</za-button>
  34. </za-popper>
  35. </div>
  36. <div style="marginLeft: 60px;clear: both">
  37. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="bottomLeft" content="bottomLeft text">
  38. <za-button ghost size="xs">BL</za-button>
  39. </za-popper>
  40. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="bottom" content="bottom text">
  41. <za-button ghost size="xs">Bottom</za-button>
  42. </za-popper>
  43. <za-popper :arrowPointAtCenter="arrow === '1'" className="custom-arrow-content" hasArrow direction="bottomRight" content="bottomRight text">
  44. <za-button ghost size="xs">BR</za-button>
  45. </za-popper>
  46. </div>
  47. </div>
  48. </za-cell>

Vue Script

  1. <script name="vue">
  2. export default {
  3. data() {
  4. return {
  5. arrow: '1',
  6. }
  7. },
  8. methods: {
  9. },
  10. };
  11. </script>

API

Attributes

属性类型默认值说明
classNamestring-气泡层类名追加
contentString-显示内容,也可以用slot
hasArrowbooleanfalse是否显示箭头节点(注:需要自行定义箭头样式)
destroybooleantrue气泡层关闭后是否移除节点
animationTypestring'zoom-fade'可选值 fade, door, flip, rotate, zoom,moveUp, moveDown, moveLeft, moveRight,slideUp, slideDown, slideLeft, slideRight
animationDurationnumber200动画执行时间(单位:毫秒)
arrowPointAtCenterbooleanfalse箭头是否指向目标元素中心
mouseEnterDelaynumber100鼠标移入显示气泡层的延时时间(单位:毫秒)
mouseLeaveDelaynumber100鼠标移出隐藏气泡层的延时时间(单位:毫秒)
directionstring'top'显示方向,可选值 topLefttoptopRightrightToprightrightBottombottomLeftbottombottomRightleftTopleftleftBottom
triggerstring移动端为'click' 桌面端为'hover'触发方式,可选值为:click 点击触发状态、hover hover 状态触发、focus 聚焦状态触发、manual 受控触发、contextMenu 右键触发
visiblebooleanfalse是否显示,trigger='manual' 时有效

Events

属性类型默认值说明
@visibleChange(visible?: boolean) => voidnoop显示/隐藏 气泡层触发的事件

Popper 气泡层 - 图1