File tree Expand file tree Collapse file tree 1 file changed +89
-0
lines changed Expand file tree Collapse file tree 1 file changed +89
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : 测试图片
3
+ description : ' Write your description here.'
4
+ publishDate : 2025-08-19 16:58:21
5
+ slug : zx7r
6
+ tags : ['tag1', 'tag2']
7
+ ---
8
+
9
+ Write your content here.
10
+
11
+ ## 测试 Figure 组件
12
+
13
+ 下面是新创建的 ` Figure ` 组件的所有布局演示,已更新为最新用法。
14
+
15
+ import Figure from ' @/components/Figure.astro' ;
16
+ import testImage from ' public/images/social-card.png' ;
17
+
18
+ ### 默认布局 (支持缩放和Markdown图注)
19
+ <Figure
20
+ src = { testImage }
21
+ alt = " 布隆过滤器图示"
22
+ layout = " bottom-center"
23
+ loading = " eager"
24
+ zoomable
25
+ >
26
+ <figcaption slot = " caption" >
27
+ 这是一个 ** 加粗的** 图注,带有一个 [ 链接] ( https://astro.build/ ) 。图片可缩放。
28
+ </figcaption >
29
+ </Figure >
30
+
31
+ ### 文字居左在下方
32
+ <Figure
33
+ src = { testImage }
34
+ alt = " 布隆过滤器图示"
35
+ layout = " bottom-left"
36
+ >
37
+ <figcaption slot = " caption" >
38
+ Layout: ` bottom-left `
39
+ </figcaption >
40
+ </Figure >
41
+
42
+ ### 文字居右在下方
43
+ <Figure
44
+ src = { testImage }
45
+ alt = " 布隆过滤器图示"
46
+ layout = " bottom-right"
47
+ >
48
+ <figcaption slot = " caption" >
49
+ Layout: ` bottom-right `
50
+ </figcaption >
51
+ </Figure >
52
+
53
+ ### 图左文右
54
+ <Figure
55
+ src = { testImage }
56
+ alt = " 布隆过滤器图示"
57
+ layout = " right"
58
+ width = " 600"
59
+ height = " 100"
60
+ zoomable
61
+ >
62
+ <figcaption slot = " caption" >
63
+ Layout: ` right ` . 这是一段描述文字,用于测试图文左右布局。这段文字应该在图片的右边。
64
+ </figcaption >
65
+ </Figure >
66
+
67
+ ### 图右文左
68
+ <Figure
69
+ src = { testImage }
70
+ alt = " 布隆过滤器图示"
71
+ layout = " left"
72
+ >
73
+ <figcaption slot = " caption" >
74
+ 1 . Layout: ` left ` . 这是一段描述文字,用于测试图文左右布局。这段文字应该在图片的左边。
75
+ 2 . 12321
76
+ </figcaption >
77
+ </Figure >
78
+
79
+ ### 悬浮显示文字 (支持缩放)
80
+ <Figure
81
+ src = { testImage }
82
+ alt = " 布隆过滤器图示"
83
+ layout = " top-hover"
84
+ >
85
+ <figcaption slot = " caption" >
86
+ - Layout: ` top-hover ` . 这段文字只在鼠标悬停时显示。** 图片也可缩放** 。
87
+ </figcaption >
88
+ </Figure >
89
+
You can’t perform that action at this time.
0 commit comments