Advertisement

区分Vue2和Vue3下Element UI Popover弹出框组件的属性、事件及方法使用方式

阅读量:

在 Vue 2 常规采用 Element UI,在Vue 3版本中由于ElementUI官方并未直接支持该框架版本,因此推出了一个官方替代品称为ElementPlus,该组件专为构建该框架而设计。下面将详细探讨Vue2和Vue3版本中对应的Component界面及其相关属性、事件与方法实现,并配以示例代码说明。

Vue 2 + Element UI Popover

属性(Props)
  • trigger: 触发触发方式('click', 'hover', 'focus', 'manual')。
    • title: 标题。
    • content: 描述内容(虽然推荐使用 slot 来定义复杂内容)。
    • width: 宽度设定。
    • placement: 弹出框显示位置。
    • value/v-model: 显示状态绑定项(主要用于 trigger='manual')。
    • visible-arrow: 箭头显示标志。
    • popper-class: 自定义弹出框类名。
    • popper-options: popper.js 配置选项设置。
    • append-to-body: 是否将弹出框插入到 body 元素中。
事件(E

全部评论 (0)

还没有任何评论哟~