# 气泡卡片

# 预览

# 使用方法

<template>
  <div class="popover">
    <xin-popover position="left">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击左侧弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="top">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击上方弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="bottom">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击下方弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="right">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击右侧弹出</xin-button>
      </template>
    </xin-popover>
    <br><br>
    <xin-popover position="left" trigger="hover">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击左侧弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="top" trigger="hover">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击上方弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="bottom" trigger="hover">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击下方弹出</xin-button>
      </template>
    </xin-popover>
    <xin-popover position="right" trigger="hover">
      <template v-slot:content>
        <div>我是Popover内容</div>
      </template>
      <template v-slot:default>
        <xin-button>点击右侧弹出</xin-button>
      </template>
    </xin-popover>
    <br><br>
    <xin-popover position="left">
      <template v-slot:content="slotProps">
        <div>我是Popover内容</div>
        <xin-button @click="slotProps.close">关闭</xin-button>
      </template>
      <template v-slot:default>
        <xin-button>左侧 内嵌关闭按钮</xin-button>
      </template>
    </xin-popover>
  </div>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

# 选项支持选项

选项

选项 取值 类型 作用
position left、right、bottom、top String 设置显示方位,默认 top
trigger hover or click String 设置触发事件,默认 click
上次更新: 2023年9月1日星期五上午9点12分