Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 313 additions & 0 deletions src/upload/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,319 @@ exports[`Upload > Upload mobileVue demo works fine 1`] = `

</div>
</div>
<div
class="tdesign-mobile-demo-block"
>
<div
class="tdesign-mobile-demo-block__header"
>
<h2
class="tdesign-mobile-demo-block__title"
>
04 可拖拽排序
</h2>
<p
class="tdesign-mobile-demo-block__summary"
>
开启拖拽排序
</p>
</div>
<div
class="tdesign-mobile-demo-block__slot"
>

<div
class="upload-demo"
data-v-10ccb48e=""
>
<div
class="upload-title"
data-v-10ccb48e=""
>
可拖拽排序
</div>
<div
class="t-upload"
data-v-10ccb48e=""
>

<div
class="t-upload__item"
draggable="true"
>
<div
class="t-image t-image--round t-upload__image"
>
<div
class="t-image__mask"
>
<div
class="t-loading"
style="font-size: 20px;"
>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>

<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>

</div>
<!---->
<!---->
</div>
</div>
<picture>
<!---->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/upload4.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
<!---->
<svg
class="t-icon t-icon-close t-upload__delete-btn"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.04996 5.63599L11.9997 10.5857L16.9494 5.63599L18.3637 7.0502L13.4139 11.9999L18.3637 16.9497L16.9494 18.3639L11.9997 13.4142L7.04996 18.3639L5.63574 16.9497L10.5855 11.9999L5.63574 7.0502L7.04996 5.63599Z"
fill="currentColor"
/>
</svg>
</div>
<div
class="t-upload__item"
draggable="true"
>
<div
class="t-image t-image--round t-upload__image"
>
<div
class="t-image__mask"
>
<div
class="t-loading"
style="font-size: 20px;"
>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>

<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>

</div>
<!---->
<!---->
</div>
</div>
<picture>
<!---->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/upload6.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
<!---->
<svg
class="t-icon t-icon-close t-upload__delete-btn"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.04996 5.63599L11.9997 10.5857L16.9494 5.63599L18.3637 7.0502L13.4139 11.9999L18.3637 16.9497L16.9494 18.3639L11.9997 13.4142L7.04996 18.3639L5.63574 16.9497L10.5855 11.9999L5.63574 7.0502L7.04996 5.63599Z"
fill="currentColor"
/>
</svg>
</div>
<div
class="t-upload__item"
draggable="true"
>
<div
class="t-image t-image--round t-upload__image"
>
<div
class="t-image__mask"
>
<div
class="t-loading"
style="font-size: 20px;"
>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>

<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>

</div>
<!---->
<!---->
</div>
</div>
<picture>
<!---->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/upload5.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
<!---->
<svg
class="t-icon t-icon-close t-upload__delete-btn"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.04996 5.63599L11.9997 10.5857L16.9494 5.63599L18.3637 7.0502L13.4139 11.9999L18.3637 16.9497L16.9494 18.3639L11.9997 13.4142L7.04996 18.3639L5.63574 16.9497L10.5855 11.9999L5.63574 7.0502L7.04996 5.63599Z"
fill="currentColor"
/>
</svg>
</div>
<div
class="t-upload__item"
draggable="true"
>
<div
class="t-image t-image--round t-upload__image"
>
<div
class="t-image__mask"
>
<div
class="t-loading"
style="font-size: 20px;"
>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>

<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>

</div>
<!---->
<!---->
</div>
</div>
<picture>
<!---->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/upload6.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
<!---->
<svg
class="t-icon t-icon-close t-upload__delete-btn"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.04996 5.63599L11.9997 10.5857L16.9494 5.63599L18.3637 7.0502L13.4139 11.9999L18.3637 16.9497L16.9494 18.3639L11.9997 13.4142L7.04996 18.3639L5.63574 16.9497L10.5855 11.9999L5.63574 7.0502L7.04996 5.63599Z"
fill="currentColor"
/>
</svg>
</div>

<div
class="t-upload__item t-upload__item--add"
>
<div
class="t-upload__add-icon"
>
<svg
class="t-icon t-icon-add"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M13 4V11L20 11V13L13 13V20H11L11 13H4L4 11L11 11L11 4L13 4Z"
fill="currentColor"
/>
</svg>
</div>
</div>
<input
accept="image/png"
hidden=""
multiple=""
type="file"
/>
<!---->
</div>
</div>

</div>
</div>
</div>
`;

Expand Down
50 changes: 50 additions & 0 deletions src/upload/demos/drag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<div class="upload-demo">
<div class="upload-title">可拖拽排序</div>
<t-upload
v-model="files"
multiple
:draggable="true"
accept="image/png"
action="//service-bv448zsw-1257786608.gz.apigw.tencentcs.com/api/upload-demo"
/>
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const files = ref([
{
url: 'https://tdesign.gtimg.com/mobile/demos/upload4.png',
name: 'image1.png',
type: 'image',
},
{
url: 'https://tdesign.gtimg.com/mobile/demos/upload6.png',
name: 'image2.png',
type: 'image',
},
{
url: 'https://tdesign.gtimg.com/mobile/demos/upload5.png',
name: 'image3.png',
type: 'image',
},
{
url: 'https://tdesign.gtimg.com/mobile/demos/upload6.png',
name: 'image4.png',
type: 'image',
},
]);
</script>

<style scoped lang="less">
.upload-demo {
background: var(--bg-color-demo, #fff);
.upload-title {
font-size: 16px;
color: var(--td-text-color-primary, rgba(0, 0, 0, 0.9));
padding: 12px 16px;
}
}
</style>
4 changes: 4 additions & 0 deletions src/upload/demos/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
<tdesign-demo-block title="03 样式自定义" summary="单选上传">
<CustomDemo />
</tdesign-demo-block>
<tdesign-demo-block title="04 可拖拽排序" summary="开启拖拽排序">
<DragDemo />
</tdesign-demo-block>
</div>
</template>
<script setup lang="ts">
import BaseDemo from './base.vue';
import CustomDemo from './custom.vue';
import MultipleDemo from './multiple.vue';
import StatusDemo from './status.vue';
import DragDemo from './drag.vue';
</script>
Loading