Comments (8)
from wot-design-uni.
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。
…
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
是小程序端,现在是通过canvas尺寸改变来压缩的。
from wot-design-uni.
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。
…
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
主要就是想是否可以提供一个可以操作这个file的一个函数。
from wot-design-uni.
from wot-design-uni.
那试试在before-upload做个处理呢。
…
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
是的,我觉得在beforeUpload最合适,可是目前我看beforeUpload之resolve一个boolean值,并没有可以操作改变file的。
beforeUpload({
files,
fileList: uploadFiles.value,
resolve: (isPass: boolean) => {
isPass && mapFiles(files)
}
})
from wot-design-uni.
那试试在before-upload做个处理呢。
…
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
所以,是否可以考虑在beforeUpload中resolve,多一个额外file的参数。
from wot-design-uni.
from wot-design-uni.
OK,那这个可以提供。
…
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:50 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 那试试在before-upload做个处理呢。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 是的,我觉得在beforeUpload最合适,可是目前我看beforeUpload之resolve一个boolean值,并没有可以操作改变file的。 beforeUpload({ files, fileList: uploadFiles.value, resolve: (isPass: boolean) => { isPass && mapFiles(files) } }) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>
感谢!
from wot-design-uni.
Related Issues (20)
- [新功能需求] form 验证时机
- tabs组件sticky的BUG HOT 1
- wd-button 组件 open-type开放能力失效 HOT 2
- [新功能需求] 骨架屏希望可以使用插槽的方式嵌入内容
- [新功能需求] form校验是否可以支持key为"xxx.xxx"形式 HOT 8
- [Bug 上报] vue-tsc 大量报错 HOT 5
- table组件文档缺少行点击事件
- [样式匹配] sort-button在cell-group中的样式匹配
- ColPicker多列选择器动态赋值,弹窗中的列头未正确的省市名,显示的请选择
- [Bug 上报] Slider滑块组件最小值设置负值有问题
- [Bug 上报] input输入框placeholder样式错误 HOT 1
- Upload 上传功能增加上传类型
- slider组件步长设置> 1无效 HOT 4
- 设置mergeVirtualHostAttributes导致微信小程序NavBar组件left箭头错位 HOT 1
- [新功能需求] Transition 组件是否可以增加一个delay延迟参数
- [新功能需求] 图片组件懒加载和状态配置(可以是插槽方式)
- [Bug 上报] Slider组件,当绑定的max或min值改变时,滑块的位置不更新
- Tabbar 标签栏自定义图标没办法区分来定义active和not-active的图标 HOT 2
- [新功能需求] 希望将wd-circle组件的canvas组件渲染方式改为 2d渲染。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wot-design-uni.