fix avatar component bug
This commit is contained in:
parent
4fc649e828
commit
dd73827112
|
@ -328,6 +328,7 @@
|
||||||
// 关闭控件
|
// 关闭控件
|
||||||
off() {
|
off() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
// 设置步骤
|
// 设置步骤
|
||||||
setStep(step) {
|
setStep(step) {
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
<el-button type="primary" icon="upload" style="position: absolute;bottom: 15px;margin-left: 40px;" @click="imagecropperShow=true">修改头像
|
<el-button type="primary" icon="upload" style="position: absolute;bottom: 15px;margin-left: 40px;" @click="imagecropperShow=true">修改头像
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<ImageCropper :width="300" :height="300" url="https://httpbin.org/post" @crop-upload-success="cropSuccess" :key="imagecropperKey" v-show="imagecropperShow" />
|
<ImageCropper :width="300" :height="300" url="https://httpbin.org/post" @close='close' @crop-upload-success="cropSuccess"
|
||||||
|
:key="imagecropperKey" v-show="imagecropperShow" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ImageCropper from 'components/ImageCropper';
|
import ImageCropper from 'components/ImageCropper';
|
||||||
import PanThumb from 'components/PanThumb';
|
import PanThumb from 'components/PanThumb';
|
||||||
|
@ -29,6 +31,9 @@
|
||||||
this.imagecropperShow = false;
|
this.imagecropperShow = false;
|
||||||
this.imagecropperKey = this.imagecropperKey + 1;
|
this.imagecropperKey = this.imagecropperKey + 1;
|
||||||
this.image = resData.files.avatar;
|
this.image = resData.files.avatar;
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.imagecropperShow = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue