Commit eea1f0a4 authored by 毛线's avatar 毛线

文件上传组件整理

parent 5ca77c4e
import Upload from './src/upload-img-list';
import Upload from './src/upload';
/* istanbul ignore next */
Upload.install = function(Vue) {
......
<template>
<div>
音频上传
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {
},
}
</script>
......@@ -32,7 +32,7 @@
import UploadImg from './upload-img'
export default{
name: 'CyUpload',
name: 'CyUploadImgList',
components: {
UploadImg,
},
......@@ -170,6 +170,7 @@ export default{
<style lang="scss" scoped>
.upload-imags-list{
font-size: 0;
overflow: auto;
.avatar-uploader{
display: block;
display: inline-block;
......
<template>
<div>
视频上传
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {
},
}
</script>
<template>
<div>
<UploadImageList
v-if="type === 'image'"
:label="label"
:limit="limit"
:edit="edit"
:dialog="dialog"
:data-type="dataType"
:tips="tips"
:source="source"
:size="size"
/>
<UploadFile v-if="type === 'file'"/>
<UploadVideo v-if="type === 'video'"/>
<UploadAudio v-if="type === 'audio'"/>
</div>
</template>
<script>
import UploadImageList from './upload-img-list'
import UploadFile from './upload-file'
import UploadVideo from './upload-video'
import UploadAudio from './upload-audio'
export default {
name: 'CyUpload',
components: {
UploadImageList,
UploadFile,
UploadVideo,
UploadAudio,
},
props: {
// 上传类型,可选值,image,file,video,audio
type: {
type: String,
default: 'image',
},
label: {
type: String,
default: '上传',
},
limit: { // 图片上传数量限制,默认10
type: Number,
default: 1,
},
value: {
type: null,
default: null,
},
edit: { // 是否可编辑
type: Boolean,
default: true,
},
// 是否使用图片库组件
dialog: {
type: Boolean,
default: true,
},
// 图片列表数据结构,json,array,string
dataType: {
type: String,
default: 'string',
},
tips: {
type: String,
default: '',
},
source: { // 上传服务器
type: String,
default: 'local', // local:本站点,qiniu:七牛云,oss:阿里云,tencent:腾讯云
},
// 组件大小
size: {
type: Number,
default: 100,
},
},
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment