5***@qq.com
5***@qq.com
  • 发布:2024-12-11 17:13
  • 更新:2024-12-11 17:25
  • 阅读:37

【报Bug】uni-file-picker通过refs调用clearFiles(index:Number)方法提示clearFiles is not a function at eval

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 11

HBuilderX类型: 正式

HBuilderX版本号: 4.28

浏览器平台: Chrome

浏览器版本: 131.0.6778.109

项目创建方式: HBuilderX

示例代码:
<uni-file-picker :ref="filePicker+index" title="气瓶图片" :limit="4" :value="gasImgs[index]" autoUpload="false" :imageStyles="imageStyles" @select="handleSelect(index,$event)" @delete="handleDelete(index,$event)" @success="handleSuccess(index,$event)">
<image src="/static/upload.png" style="width: 90px;height: 90px;" mode="aspectFit"></image>
</uni-file-picker>

this.$refs["filePicker0"].clearFiles(0);

操作步骤:
<uni-file-picker :ref="filePicker+index" title="气瓶图片" :limit="4" :value="gasImgs[index]" autoUpload="false" :imageStyles="imageStyles" @select="handleSelect(index,$event)" @delete="handleDelete(index,$event)" @success="handleSuccess(index,$event)">
<image src="/static/upload.png" style="width: 90px;height: 90px;" mode="aspectFit"></image>
</uni-file-picker>

this.$refs["filePicker0"].clearFiles(0);

预期结果:
<uni-file-picker :ref="filePicker+index" title="气瓶图片" :limit="4" :value="gasImgs[index]" autoUpload="false" :imageStyles="imageStyles" @select="handleSelect(index,$event)" @delete="handleDelete(index,$event)" @success="handleSuccess(index,$event)">
<image src="/static/upload.png" style="width: 90px;height: 90px;" mode="aspectFit"></image>
</uni-file-picker>

this.$refs["filePicker0"].clearFiles(0);

实际结果:

Uncaught (in promise) TypeError: _this.$refs.filePicker0.clearFiles is not a function
at eval

bug描述:

uni-file-picker通过refs调用clearFiles(index:Number)方法提示clearFiles is not a function at eval uni-ui为最新版本1.5.7

2024-12-11 17:13 负责人:无 分享
已邀请:
a***@163.com

a***@163.com

:ref="filePicker+index"这个里面的filePicker是个变量吗?

要回复问题请先登录注册