fix avatar component bug

This commit is contained in:
Pan 2017-06-13 11:04:54 +08:00
parent 4fc649e828
commit dd73827112
2 changed files with 7 additions and 1 deletions

View file

@ -328,6 +328,7 @@
// //
off() { off() {
this.show = false; this.show = false;
this.$emit('close');
}, },
// //
setStep(step) { setStep(step) {

View file

@ -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;
} }
} }
}; };