Popup 弹出层
Popup 即将废弃,当前仅作为迁移期兼容入口保留。新项目请使用 Popover 气泡卡片。
Popup 用于围绕触发元素展示一块自定义浮层内容。它现在基于 Popover 兼容实现,已有代码可以继续使用;后续新能力只会优先放在 Popover。
基础用法
vue
<template>
<x-popup title="兼容 Popup" content="Popup 仍可使用,但推荐迁移到 Popover。">
<x-button type="primary">点击打开</x-button>
</x-popup>
</template>迁移到 Popover
vue
<template>
<x-popover title="推荐 Popover" content="Popover 是后续推荐使用的通用浮动卡片组件。">
<x-button type="primary">使用 Popover</x-button>
</x-popover>
</template>按需导入
ts
import { Popup, Popover } from 'x-next';API
Popup 当前复用 Popover 的 props、events 和 slots。详见 Popover API。