-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playground): add upload playground
- Loading branch information
‘xiuxiu-yang’
committed
Feb 13, 2023
1 parent
eb11d2f
commit 6c0336c
Showing
2 changed files
with
56 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,54 @@ | ||
<script setup lang="ts"> | ||
import { LButton, LUpload } from 'lucky-design' | ||
const onSuccess = (res: any) => { | ||
// console.log(res) | ||
} | ||
const onProgress = (ev: ProgressEvent<XMLHttpRequestEventTarget>) => { | ||
// console.log(ev) | ||
} | ||
const beforeUpload = (file: File) => { | ||
// console.log(file) | ||
return Promise.resolve() | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div>upload</div> | ||
<div> | ||
<p> | ||
<LUpload | ||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" | ||
name="file" | ||
:on-success="onSuccess" | ||
:on-progress="onProgress" | ||
> | ||
<LButton text="上传" type="primary" /> | ||
</LUpload> | ||
</p> | ||
<p> | ||
<LUpload | ||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" | ||
name="file" | ||
:multiple="true" | ||
:on-success="onSuccess" | ||
:on-progress="onProgress" | ||
> | ||
<LButton text="上传" type="primary" /> | ||
</LUpload> | ||
</p> | ||
<p> | ||
<LUpload | ||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" | ||
name="file" | ||
:before-upload="beforeUpload" | ||
:on-success="onSuccess" | ||
:on-progress="onProgress" | ||
> | ||
<LButton text="上传" type="primary" /> | ||
</LUpload> | ||
</p> | ||
</div> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
declare module 'lucky-design' { | ||
import { LButton, LCheckbox, LDrawer, LMessage, LTree } from 'lucky-design' | ||
export { LButton, LCheckbox, LDrawer, LMessage, LTree } | ||
import { | ||
LButton, | ||
LCheckbox, | ||
LDrawer, | ||
LMessage, | ||
LTree, | ||
LUpload, | ||
} from 'lucky-design' | ||
export { LButton, LCheckbox, LDrawer, LMessage, LTree, LUpload } | ||
} |