优化图片

This commit is contained in:
java110 2020-05-31 15:14:41 +08:00
parent 1002f04a76
commit 18c0e3d468
4 changed files with 11 additions and 3 deletions

View File

@ -4,9 +4,9 @@
<span v-on:click="this._removeImage(image)" class="fa fa-remove float-right"
style="position: relative; right: 20px; color: #d9534f"></span>
</div>
<div class="uploadButton" v-on:click="this._uploadPhoto()">
<div class="uploadButton" v-on:click="this._uploadPhoto()" v-if= "this.uploadImageInfo.photos < this.uploadImageInfo.imageCount">
<i class="fa fa-plus" aria-hidden="true"></i>
</div>
<input type="file" class="file" accept="image/*" id="uploadImage" hidden
<input type="file" class="file" accept="image/*" id="uploadImage" v-if= "this.uploadImageInfo.photos < this.uploadImageInfo.imageCount" hidden
v-on:change="this._choosePhoto($event)">
</div>

View File

@ -5,11 +5,13 @@
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
callBackFunction: vc.propTypes.string //父组件监听方法
callBackFunction: vc.propTypes.string, //父组件监听方法
imageCount: vc.propTypes.string = '99' // -1 不限制
},
data: {
uploadImageInfo: {
photos: [],
imageCount: 99
}
},
watch: {
@ -21,6 +23,10 @@
}
},
_initMethod: function () {
let _imageCount = $props.imageCount;
if (_imageCount != 99) {
this.uploadImageInfo.imageCount = _imageCount;
}
},
_initEvent: function () {

View File

@ -32,6 +32,7 @@
<vc:create path="frame/uploadImage"
callBackListener="addActivitiesView"
callBackFunction="notifyUploadImage"
imageCount="1"
namespace="addActivitiesView"
></vc:create>
</div>

View File

@ -33,6 +33,7 @@
<vc:create path="frame/uploadImage"
callBackListener="editActivitiesView"
callBackFunction="notifyUploadImage"
imageCount="1"
namespace="editActivitiesView"
></vc:create>
</div>