@beisen-phoenix/dropdown

@beisen-phoenix/dropdown

Usage no npm install needed!

<script type="module">
  import beisenPhoenixDropdown from 'https://cdn.skypack.dev/@beisen-phoenix/dropdown';
</script>

README

下拉菜单

@beisen-phoenix/dropdown

概述

用于按钮、文字、图标下拉菜单

Dropdown API

参数 说明 类型 默认值 是否必传
disable 是否禁用 boolean false
visible 弹层是否显示 boolean false
trigger 触发展示的行为: hover click click / ['click'] ``
content 弹窗内容 React.ReactNode --
layerSize 尺寸大小: small(170px) large(340px) auto(与父级自适应) small large auto --
prefixCls 弹层根元素的类名称 string “common-unmodeled-layer”
blockContainer 外层容器的显示类型(true是block类型,false则是inline-block) Boolean false
placement 弹层的显示位置(可选值:topLeft, topRight, bottomRight, bottomLeft) string bottomLeft
builtinPlacements 弹层的可定义偏移位置(具体可参考dom-align) object --
childMargin 子组件的外边距 string 0px
getPopupContainer 弹层挂载的容器(默认是挂载到body下,通过此函数可以改变弹层挂载的节点) Funtion --
onVisibleChange 弹层显示状态改变时调用, 参数为visible (visible: boolean) => void

builtinPlacements取值举例

{
  topLeft: {
    points: ['bl', 'tl'],
  },
  topRight: {
    points: ['br', 'tr'],
  },
  bottomRight: {
    points: ['tr', 'br'],
  },
  bottomLeft: {
    points: ['tl', 'bl'],
    offset: [-11, -15]
  },
}