vue把附件放到textarea输入框发送,也就是说点击按钮做好了,textarea输入框怎么获取到附件数据?

菜鸟也能高飞
  • 57

<template>
<el-upload

          class="upload-demo"
          action="https://jsonplaceholder.typicode.com/posts/"
          :on-change="handleChange"
          :file-list="fileList">
          <el-button size="small" type="primary">
            <img src="../public/images/annex.png" class="annex"/>
            <!-- <img src="../public/images/annex.png" class="annex" @click="uploadFiles()" > -->
          </el-button>
          <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
        </el-upload>

</template>
<script>
export default {
name: 'userClient',
data () {

return {
  // 上传附件
  fileList: [{
      //   name: 'food.jpeg',
      //   url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
      // }, {
      //   name: 'food2.jpeg',
      //   url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
      }
    ]
}

},
methods: {
// 上传附件

handleChange(file, fileList) {
  this.fileList = fileList.slice(-3);
},

}

</script>
图片描述

回复
阅读 1.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏