console
const Main = {
data(){
return {
}
},
methods: {
handleChange(file, fileList) {
console.log('upload status has changed')
console.log(file)
}
}
}
const Demo = Vue.extend(Main)
new Demo().$mount('#app')
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.11.0/lib/index.js"></script>
<div id="app">
<el-upload
class="upload-demo"
drag
:auto-upload="false"
:on-change="handleChange"
action="https://jsonplaceholder.typicode.com/posts/"
accept="image/*"
multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
</el-upload>
</div>
@import url("//unpkg.com/element-ui@2.11.0/lib/theme-chalk/index.css");