emis-sapp/components/tpx-upload/tpx-upload.vue
2023-12-11 17:44:17 +08:00

70 lines
961 B
Vue

<template>
<u-upload
:fileList="fileList1" name="formFilesTODO" :maxCount="max" :previewFullImage="fileType==fileTypeEnum.image"
@afterRead="afterRead" @delete="deletePic"
>
<slot></slot>
</u-upload>
</template>
<script>
const fileTypeEnum = {
all: "all",
image: "image",
video: "video",
}
export default {
props: {
value: {
default () {
return ''
}
},
fileType: {
default () {
return fileTypeEnum.all
}
},
max: {
default () {
return 1
}
},
min: {
default () {
return 1
}
},
scale: {
default () {
return [1, 1] // 宽高比
}
}
},
data() {
return {
fileTypeEnum: Object.assign({}, fileTypeEnum),
}
},
created() {
},
onHide() {
},
destroyed() {},
methods: {
handleChange(val){
this.$emit('change', val)
this.$emit('update:value', val)
}
}
}
</script>
<style scoped lang="scss">
</style>