-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ImageViewer sfc to tsx,支持预加载,支持设置默认位置 (#1422)
* refactor(image-viewer): sfc to tsx,添加tsx文件 * feat(image-viewer): 添加图片预加载功能,节省资源 * feat(image-viewer): 支持设置图片对齐方式 * refactor(image-viewer): 删除无用文件 * refactor(image-viewer): 优化代码 * test(image-viewer): 更新测试代码 * docs(image-viewer): 更新文档 * refactor(image-viewer): 更新类型文件 * refactor(image-viewer): 删除无用的文件 * refactor(image-viewer): 优化代码使用useTNodeJSX * test: update snapshots * refactor(image-viewer): 更新_common索引
- Loading branch information
Showing
15 changed files
with
230 additions
and
132 deletions.
There are no files selected for viewing
Submodule _common
updated
25 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<t-button block size="large" variant="outline" theme="primary" @click="visible = true"> | ||
基础图片预览 + 对齐方式 | ||
</t-button> | ||
<t-image-viewer v-model:images="images" v-model:visible="visible" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
const visible = ref(false); | ||
const images = [ | ||
{ | ||
url: 'https://tdesign.gtimg.com/mobile/demos/swiper1.png', | ||
align: 'start', | ||
}, | ||
{ | ||
url: 'https://tdesign.gtimg.com/mobile/demos/swiper2.png', | ||
align: 'end', | ||
}, | ||
{ | ||
url: 'https://tdesign.gtimg.com/mobile/demos/swiper2.png', | ||
align: 'center', | ||
}, | ||
]; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface ImageInfo { | ||
url: string; | ||
align: 'start' | 'center' | 'end'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.