Commit dd738271 authored by Pan's avatar Pan

fix avatar component bug

parent 4fc649e8
...@@ -328,6 +328,7 @@ ...@@ -328,6 +328,7 @@
// 关闭控件 // 关闭控件
off() { off() {
this.show = false; this.show = false;
this.$emit('close');
}, },
// 设置步骤 // 设置步骤
setStep(step) { setStep(step) {
......
...@@ -9,9 +9,11 @@ ...@@ -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 @@ ...@@ -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;
} }
} }
}; };
......
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