File tree Expand file tree Collapse file tree 3 files changed +62
-0
lines changed
Expand file tree Collapse file tree 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`] = `
77</div >
88`;
99
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+
1022exports[`renders ./components/image/demo/fallback.vue correctly 1`] = `
1123<div class = " ant-image" style = " width: 200px; height: 200px;" ><img class = " ant-image-img" src = " https://www.antdv.com/#error" >
1224 <!---->
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 44 <fallback />
55 <placeholder />
66 <preview-group />
7+ <controlled-preview />
78 </demo-sort >
89</template >
910
@@ -12,6 +13,7 @@ import Basic from './basic.vue';
1213import Fallback from ' ./fallback.vue' ;
1314import Placeholder from ' ./placeholder.vue' ;
1415import PreviewGroup from ' ./previewGroup.vue' ;
16+ import ControlledPreview from ' ./controlledPreview.vue' ;
1517
1618import CN from ' ../index.zh-CN.md' ;
1719import US from ' ../index.en-US.md' ;
@@ -24,6 +26,7 @@ export default defineComponent({
2426 Fallback ,
2527 Placeholder ,
2628 PreviewGroup ,
29+ ControlledPreview ,
2730 },
2831});
2932 </script >
You can’t perform that action at this time.
0 commit comments