-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 初始交互完成 * feat: 交互功能完成 * feat: 删除添加配合排序完成 * feat: 完成交互 * feat: 完成拖拽排序 * feat: 完成示例 * feat: 完成拖拽排序 * chore: 优化注释 * fix: 修复优化 * fix: 修复bug * test: update snapshots --------- Co-authored-by: anlyyao <[email protected]>
- Loading branch information
1 parent
5167bee
commit 8fb4efd
Showing
17 changed files
with
736 additions
and
83 deletions.
There are no files selected for viewing
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,55 @@ | ||
Component({ | ||
data: { | ||
originFiles: [ | ||
{ | ||
url: 'https://tdesign.gtimg.com/miniprogram/images/example4.png', | ||
name: 'uploaded1.png', | ||
type: 'image', | ||
}, | ||
{ | ||
url: 'https://tdesign.gtimg.com/miniprogram/images/example6.png', | ||
name: 'uploaded2.png', | ||
type: 'image', | ||
}, | ||
{ | ||
url: 'https://tdesign.gtimg.com/miniprogram/images/example5.png', | ||
name: 'uploaded3.png', | ||
type: 'image', | ||
}, | ||
], | ||
gridConfig: { | ||
column: 4, | ||
width: 160, | ||
height: 160, | ||
}, | ||
config: { | ||
count: 1, | ||
}, | ||
}, | ||
methods: { | ||
handleSuccess(e) { | ||
const { files } = e.detail; | ||
this.setData({ | ||
originFiles: files, | ||
}); | ||
}, | ||
handleRemove(e) { | ||
const { index } = e.detail; | ||
const { originFiles } = this.data; | ||
originFiles.splice(index, 1); | ||
this.setData({ | ||
originFiles, | ||
}); | ||
}, | ||
handleClick(e) { | ||
console.log(e.detail.file); | ||
}, | ||
|
||
handleDrop(e) { | ||
const { files } = e.detail; | ||
this.setData({ | ||
originFiles: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-upload": "tdesign-miniprogram/upload/upload" | ||
} | ||
} |
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,13 @@ | ||
<view class="wrapper"> | ||
<t-upload | ||
draggable | ||
disabled | ||
media-type="{{['video','image']}}" | ||
files="{{originFiles}}" | ||
gridConfig="{{gridConfig}}" | ||
bind:success="handleSuccess" | ||
bind:remove="handleRemove" | ||
bind:click="handleClick" | ||
bind:drop="handleDrop" | ||
/> | ||
</view> |
Empty file.
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
Oops, something went wrong.