File tree 3 files changed +62
-0
lines changed
3 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,18 @@ exports[`renders ./components/image/demo/basic.vue correctly 1`] = `
7
7
</div >
8
8
`;
9
9
10
+ exports[`renders ./components/image/demo/controlledPreview.vue correctly 1`] = `
11
+ <div ><button class = " ant-btn ant-btn-primary" type = " button" >
12
+ <!----><span >show image preview</span >
13
+ </button >
14
+ <div class = " ant-image" style = " width: 200px;" ><img class = " ant-image-img" style = " display: none;" src = " https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" >
15
+ <!---->
16
+ <!---->
17
+ </div >
18
+ <!---->
19
+ </div >
20
+ `;
21
+
10
22
exports[`renders ./components/image/demo/fallback.vue correctly 1`] = `
11
23
<div class = " ant-image" style = " width: 200px; height: 200px;" ><img class = " ant-image-img" src = " https://www.antdv.com/#error" >
12
24
<!---->
Original file line number Diff line number Diff line change
1
+ <docs >
2
+ ---
3
+ order: 4
4
+ title:
5
+ zh-CN: 受控的预览
6
+ en-US: Controlled Preview
7
+ ---
8
+
9
+ ## zh-CN
10
+
11
+ 可以使预览受控。
12
+
13
+ ## en-US
14
+
15
+ You can make preview controlled.
16
+
17
+ </docs >
18
+
19
+ <template >
20
+ <div >
21
+ <a-button type =" primary" @click =" () => setVisible(true)" >show image preview</a-button >
22
+ <a-image
23
+ :width =" 200"
24
+ :style =" { display: 'none' }"
25
+ :preview =" {
26
+ visible,
27
+ onVisibleChange: setVisible,
28
+ }"
29
+ src =" https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
30
+ />
31
+ </div >
32
+ </template >
33
+ <script lang="ts">
34
+ import { defineComponent , ref } from ' vue' ;
35
+ export default defineComponent ({
36
+ setup() {
37
+ const visible = ref <boolean >(false );
38
+ const setVisible = (value ): void => {
39
+ visible .value = value ;
40
+ };
41
+ return {
42
+ visible ,
43
+ setVisible ,
44
+ };
45
+ },
46
+ });
47
+ </script >
Original file line number Diff line number Diff line change 4
4
<fallback />
5
5
<placeholder />
6
6
<preview-group />
7
+ <controlled-preview />
7
8
</demo-sort >
8
9
</template >
9
10
@@ -12,6 +13,7 @@ import Basic from './basic.vue';
12
13
import Fallback from ' ./fallback.vue' ;
13
14
import Placeholder from ' ./placeholder.vue' ;
14
15
import PreviewGroup from ' ./previewGroup.vue' ;
16
+ import ControlledPreview from ' ./controlledPreview.vue' ;
15
17
16
18
import CN from ' ../index.zh-CN.md' ;
17
19
import US from ' ../index.en-US.md' ;
@@ -24,6 +26,7 @@ export default defineComponent({
24
26
Fallback ,
25
27
Placeholder ,
26
28
PreviewGroup ,
29
+ ControlledPreview ,
27
30
},
28
31
});
29
32
</script >
You can’t perform that action at this time.
0 commit comments