按照文档里:
antd
我写了一模一样的a-upload-dragger组件
他没有报错,但是我
运行起来会有一个warning:
warning.js?d96e:34 Warning: `getFieldDecorator` will override `fileList`, so please don't set `fileList and v-model` directly and use `setFieldsValue` to set it.
很烦人
如何解决?
我的代码:
<a-form-item label="乐谱文件" v-bind="formItemLayout2">
<div class="dropbox">
<a-upload-dragger
v-decorator="[
'dragger',
{
valuePropName: 'fileList',
getValueFromEvent: normFile,
rules: [
{
validator: checkFiles,
required: true,
message: '请至少上传一个文件'
}
]
}
]"
name="scoreFiles"
:multiple="true"
:customRequest="uploadFiles"
>
<p class="ant-upload-drag-icon">
<a-icon type="inbox" />
</p>
<p class="ant-upload-text">
点击或拖拽上传
</p>
<p class="ant-upload-hint">
支持单文件或多个文件
</p>
</a-upload-dragger>
</div>
</a-form-item>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…