Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

antd的form组件为什么会报这个错误?

按照文档里:
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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...