File tree Expand file tree Collapse file tree 9 files changed +173
-155
lines changed Expand file tree Collapse file tree 9 files changed +173
-155
lines changed Original file line number Diff line number Diff line change 1+ <cn >
2+ #### 箭头指向
3+ 设置了 ` arrowPointAtCenter ` 后,箭头将指向目标元素的中心。
4+ </cn >
5+
6+ <us >
7+ #### Arrow pointing
8+ The arrow points to the center of the target element, which set ` arrowPointAtCenter ` .
9+ </us >
10+
11+ ``` html
12+ <template >
13+ <div >
14+ <a-popover placement =" topLeft" >
15+ <template slot =" content" >
16+ <p >Content</p >
17+ <p >Content</p >
18+ </template >
19+ <span slot =" title" >Title</span >
20+ <a-button >Align edge / 边缘对齐</a-button >
21+ </a-popover >
22+ <a-popover placement =" topLeft" arrowPointAtCenter >
23+ <template slot =" content" >
24+ <p >Content</p >
25+ <p >Content</p >
26+ </template >
27+ <span slot =" title" >Title</span >
28+ <a-button >Arrow points to center / 箭头指向中心</a-button >
29+ </a-popover >
30+ </div >
31+ </template >
32+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- <template >
2- <div >
3- <md >
4- ## 基本
1+ <cn >
2+ #### 基本
53最简单的用法,浮层的大小由内容区域决定。
6- </md >
7- <Popover title =" Title" >
4+ </cn >
5+
6+ <us >
7+ #### Basic
8+ The most basic example. The size of the floating layer depends on the contents region.
9+ </us >
10+
11+ ``` html
12+ <template >
13+ <a-popover title =" Title" >
814 <template slot =" content" >
915 <p >Content</p >
1016 <p >Content</p >
1117 </template >
1218 <a-button type =" primary" >Hover me</a-button >
13- </Popover >
14- </div >
19+ </a-popover >
1520</template >
16-
17- <script >
18- import { Popover , Button } from ' antd'
19- export default {
20- components: {
21- Popover,
22-
23- },
24- }
25- </script >
21+ ```
Original file line number Diff line number Diff line change 1+ <cn >
2+ #### 从浮层内关闭
3+ 使用 ` visible ` 属性控制浮层显示。
4+ </cn >
5+
6+ <us >
7+ #### Controlling the close of the dialog
8+ Use ` visible ` prop to control the display of the card.
9+ </us >
10+
11+ ``` html
112<template >
2- <div >
3- <md >
4- ## 从浮层内关闭
5- 使用 `visible` 属性控制浮层显示。
6- </md >
7- <Popover
13+ <a-popover
814 title =" Title"
915 trigger =" click"
1016 v-model =" visible"
1117 >
1218 <a @click =" hide" slot =" content" >Close</a >
1319 <a-button type =" primary" >Click me</a-button >
14- </Popover >
15- </div >
20+ </a-popover >
1621</template >
1722
1823<script >
19- import { Popover , Button } from ' antd'
2024export default {
2125 data () {
2226 return {
@@ -29,9 +33,6 @@ export default {
2933 this .visible = false
3034 },
3135 },
32- components: {
33- Popover,
34-
35- },
3636}
3737 </script >
38+ ```
Original file line number Diff line number Diff line change 1- <template >
2- <div >
3- <h1 >Basic</h1 >
4- <Basic />
5- <h1 >ArrowCenter</h1 >
6- <ArrowCenter />
7- <h1 >Control</h1 >
8- <Control />
9- <h1 >Placement</h1 >
10- <Placement />
11- <h1 >TriggerType</h1 >
12- <TriggerType />
13- </div >
14- </template >
151<script >
162import Basic from ' ./basic'
173import ArrowCenter from ' ./arrow-point-at-center'
184import Control from ' ./control'
195import Placement from ' ./placement'
206import TriggerType from ' ./triggerType'
7+ import CN from ' ../index.zh-CN.md'
8+ import US from ' ../index.en-US.md'
9+
10+ const md = {
11+ cn: ` # Popover
12+
13+ 点击/鼠标移入元素,弹出气泡式的卡片浮层。
14+
15+ ## 何时使用
16+
17+ 当目标元素有进一步的描述和相关操作时,可以收纳到卡片中,根据用户的操作行为进行展现。
18+
19+ 和 \` Tooltip\` 的区别是,用户可以对浮层上的元素进行操作,因此它可以承载更复杂的内容,比如链接或按钮等。
20+ ## 代码演示` ,
21+ us: ` # Popover
22+
23+ The floating card popped by clicking or hovering.
24+
25+ ## When To Use
26+
27+ A simple popup menu to provide extra information or operations.
28+
29+ Comparing with \` Tooltip\` , besides information \` Popover\` card can also provide action elements like links and buttons.
30+ ## Examples
31+ ` ,
32+ }
2133export default {
2234 category: ' Components' ,
2335 subtitle: ' 气泡卡片' ,
2436 type: ' Data Display' ,
2537 title: ' Popover' ,
26- components: {
27- Basic,
28- ArrowCenter,
29- Control,
30- Placement,
31- TriggerType,
38+ render () {
39+ return (
40+ < div>
41+ < md cn= {md .cn } us= {md .us }/ >
42+ < Basic / >
43+ < ArrowCenter / >
44+ < Control / >
45+ < Placement / >
46+ < TriggerType / >
47+ < api>
48+ < template slot= ' cn' >
49+ < CN / >
50+ < / template>
51+ < US / >
52+ < / api>
53+ < / div>
54+ )
3255 },
3356}
3457 </script >
You can’t perform that action at this time.
0 commit comments