Files
magic-boot/magic-boot-ui/src/views/examples/upload-file.vue
T
2022-05-15 18:07:30 +08:00

46 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div style="padding: 50px;">
<h2>上传文件单文件</h2>
<mb-upload-file v-model="fileUrl" @change="fileChange" />
<h2>上传文件多文件</h2>
<mb-upload-file v-model="fileUrls" @change="multipleFileChange" multiple />
<h2>上传图片id</h2>
<mb-upload-image :external-id="externalId" multiple :external-type="externalType" />
<h2>上传图片url单图</h2>
<mb-upload-image v-model="imgUrl" @change="imgChange" tip="建议上传尺寸:710*345" />
<h2>上传图片url多图</h2>
<mb-upload-image v-model="multipleImgUrl" :width="120" :height="120" multiple :limit="3" @change="multipleImgChange" />
</div>
</template>
<script>
export default {
name: 'UploadFile',
data() {
return {
externalId: this.$common.uuid(),
externalType: '营业执照',
imgUrl: '',
multipleImgUrl: '',
fileUrl: '',
fileUrls: ''
}
},
methods: {
fileChange() {
console.log(this.fileUrl)
},
multipleFileChange() {
console.log(this.fileUrls)
},
imgChange() {
console.log(this.imgUrl)
},
multipleImgChange() {
console.log(this.multipleImgUrl)
}
}
}
</script>