官网的例子没有给删除和下载的功能,现在只记录下删除js操作
<script type="text/javascript">
var Main = {
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
disabled: false
};
},
methods: {
handleRemove(file) {
var list =document.querySelectorAll("li");
for (var i = 0; i < list.length; i++) {
(function (i) {
list[i].onclick = function () {
list[i].remove();
}
})(i);
}
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handleDownload(file) {
console.log(file);
},
submitUpload(){
this.$refs.upload.submit();
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
</script>