vue中vue-core-image-upload组件

来源:互联网 发布:淘宝卖家店铺工具分析 编辑:程序博客网 时间:2024/06/10 10:09
<div class="upload clear"> <span>营业执照</span>   <vue-core-image-upload     :class="['btn', 'btn-primary']"     :crop="false"     @imageuploaded="imageuploaded"     input-of-file="file"     :max-file-size="5242880"     :url="uploadUrl">     <img width="150" :src="formData.license" />   </vue-core-image-upload> </div><script>import VueCoreImageUpload  from 'vue-core-image-upload'//上传图片imageuploaded(res) {   console.log(res)   if(res.code == 0){     this.formData.license = res.url;   } },</script>//upload样式.upload{  width: 100%;  border-top: 1px solid #e1e1e1;  padding: 0.3rem 0;  span{    width: 3rem;    line-height: 0.8rem;    font-size: 0.42rem;    float: left;    padding-left: 0.3rem;    box-sizing: border-box;  }  .btn-primary{    background-color: #16c2c2;    color: #fff;    padding: 0.3rem;    height: 4rem;    width: 5rem;    float: left;    img{      width: 100%;      height: 100%;    }  }}.g-core-image-upload-form{  width: 100%!important;  height: 100%!important;}

详细请点这里vue-core-image-upload源码地址
文档vue-core-image-upload文档配置

原创粉丝点击