vue-upload 封装组件-上传组件
我后端的,刚接触vue个星期,根据需求写了个上传控件,很灵活的。没有看element el-upload源码,样式用的element的。感觉vue确实好用。 先看样子: <!-- 单文件上传组件 --> < template > < div > < input type ="file" id ="file" hidden @change ="fileChange" :accept ="accept" > < div v-if ="upMode=='url'" style ="width: 100%;display:inline-flex;" > < el-input :value ="path" disabled ></ el-input > < el-button size ="small" type ="primary" @click ="btnChange" > {{autoUpload?label:'选择文件'}} </ el-button > < el-button v-if ="!autoUpload && loadButton" size ="small" type ="success" @click ="uploadClick" > {{label}} </ el-button > </ div > < div v-else-if ="upMode=='head'"