跳到主要内容
Popover
气泡框用于在某个元素的周围弹出一个小型的浮层,显示一些简单的辅助信息,例如提示、说明或状态等。

示例

基本用法

PCPhonePad
<page>
<popover
x="popover"
trigger="click"
title="popover title"
subtitle="popover subtitle"
width="350"
placement="right"
bind-hided="handlePopoverHide"
bind-shown="handlePopoverShow"
>
<button text="show popover" slot="reference"></button>
<main>
<left width="150px">
<image width="149px" height="149px" mode="cover" src="https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg" ></image>
</left>
<main style="padding: 0 8px;">
图片说明
</main>
</main>
<actions>
<button text="取消" bind-click="hidePopover"></button>
<button text="确定" status="primary" bind-click="showPopover"></button>
</actions>
</popover>
</page>


export default XPage({

data: {},

handlePopoverShow(...args) {
console.info('shown', ...args);
},

handlePopoverHide(...args) {
console.info('hided', ...args);
},

showPopover() {
debugger;
this.getComponent('popover').show();
},

hidePopover() {
debugger;
this.getComponent('popover').hide();
},
});


Attributes

参数说明类型可选值默认值版本
title标题String----PC/Mobile--
subtitle副标题String----PC/Mobile--
width宽度String/Number----PC/Mobile--
trigger触发方式Stringclick/hoverclickPC/Mobile--
placement出现位置(Mobile 只有bottom)Stringtop/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-endbottomPC--

Slot

名称说明
reference触发Popover显示元素

Events

名称说明回调参数
shown显示Popover回调--
hided隐藏Popover回调--