1.若是想显示输入vv号展现头像和昵称能够用如下方法:dom
显示vv号 回车显示昵称头像<body> <label style="margin-left:20px;">用户ID: </label> <span @blur="getUserInfo()" v-if="modifyModal.type == 2">{{editParams.userid}}</span> <Input v-if="modifyModal.type == 1" style="width:120px;" v-model="editParams.userid" @blur="getUserInfo()" @keyup.enter.native="getUserInfo()"></Input> :@keyup.enter.native=""(回车或者点击) 显示昵称: <label style="margin-left:20px;">昵称: </label> <span style="margin-left:14px;">{{editParams.nickname}}</span> 显示照片: <label style="margin-left:20px;">用户照片:</label></br> <img :src="(editParams.photo)" style="width:80px;height:80px;" class="img_image"> <a :href="editParams.photo" class="http_a" download='' target="_blank"> <Button type="warning" >下载图片</Button></a> a标签连接 下载图片
js相应的地方传参数this
2.传分页参数的时候要根据后台返回的传spa
this.totalSize = data.total || 0;
3.(新增显示用户头像之后上传裁剪图片不显示裁剪图像或者是编辑不显示裁剪头像,还有就是新增不显示用户头像只有添加裁剪头像之后才能显示裁剪后的头像)这是遇到的一个坑code
if (cutImg.dom_shade_img.src == location.href && !this.editParams.photo) { this.$Message.success('请添加照片'); return } if (this.editParams.photo && cutImg.dom_shade_img.src == location.href) { this.submitData(this.editParams.photo, 1) return }
传参数的时候传裁剪后的图片或者是头像orm
photo: type == 1 ? this.editParams.photo : ('https://'+photo),
type == 1是我加了个区分 新增编辑的肯定用1或2判断接口
<Button type="success" @click="modifySure" v-if="modifyModal&&modifyModal.type == 1">保存</Button> <Button type="success" @click="modifySure" v-if="modifyModal&&modifyModal.type == 2">肯定</Button>
4.裁剪头像的写法在晚会工做人员里图片
1.把俩个跳转页面的共同table写在了一块儿(由于内容是同样的)ip
<div class="form_zuhud" v-if="recommendFlag||modifyModal"> <Table :stripe="false" border align="center" > <thead> <tr> <th>专区</th> <th>活动</th> </tr> </thead> <tbody> <tr> <td>{{parentStractName}}</td> <td>{{title}}</td> </tr> </tbody> </Table> </div>
添加工做人员的参数传错了 再添加按钮的部分添加而后接口传参用get
amend(item){ this.activityid = item.activityid; this.parentStractId = item.parentStractId; this.dataDome(item.activityid,item.parentStractId) },
dataDome给添加接口赋值,(查询已添加的人展现出来),详细看代码it