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
+ #### 基本
5
3
最简单的用法,浮层的大小由内容区域决定。
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" >
8
14
<template slot =" content" >
9
15
<p >Content</p >
10
16
<p >Content</p >
11
17
</template >
12
18
<a-button type =" primary" >Hover me</a-button >
13
- </Popover >
14
- </div >
19
+ </a-popover >
15
20
</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
1
12
<template >
2
- <div >
3
- <md >
4
- ## 从浮层内关闭
5
- 使用 `visible` 属性控制浮层显示。
6
- </md >
7
- <Popover
13
+ <a-popover
8
14
title =" Title"
9
15
trigger =" click"
10
16
v-model =" visible"
11
17
>
12
18
<a @click =" hide" slot =" content" >Close</a >
13
19
<a-button type =" primary" >Click me</a-button >
14
- </Popover >
15
- </div >
20
+ </a-popover >
16
21
</template >
17
22
18
23
<script >
19
- import { Popover , Button } from ' antd'
20
24
export default {
21
25
data () {
22
26
return {
@@ -29,9 +33,6 @@ export default {
29
33
this .visible = false
30
34
},
31
35
},
32
- components: {
33
- Popover,
34
-
35
- },
36
36
}
37
37
</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 >
15
1
<script >
16
2
import Basic from ' ./basic'
17
3
import ArrowCenter from ' ./arrow-point-at-center'
18
4
import Control from ' ./control'
19
5
import Placement from ' ./placement'
20
6
import 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
+ }
21
33
export default {
22
34
category: ' Components' ,
23
35
subtitle: ' 气泡卡片' ,
24
36
type: ' Data Display' ,
25
37
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
+ )
32
55
},
33
56
}
34
57
</script >
You can’t perform that action at this time.
0 commit comments