From b322b2bad8b2f9b88521c9ffbbe7e77282b9fe2e Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期四, 08 七月 2021 18:06:45 +0800 Subject: [PATCH] 头像修改 --- src/pages/settings/index/App.vue | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/pages/settings/index/App.vue b/src/pages/settings/index/App.vue index 2589ff2..8d0114c 100644 --- a/src/pages/settings/index/App.vue +++ b/src/pages/settings/index/App.vue @@ -141,6 +141,12 @@ <span v-show="!showInputNickName" class="icon iconfont" @click="editNickName" ></span > + <span v-show="showInputNickName" class="icon iconfont" @click="showInputNickName=false" + ></span + > + <span v-show="showInputNickName" class="icon iconfont" style="font-size:21px;font-weight:600;color:green;" @click="hideInputNick" + ></span + > </div> <div class="user-role"> {{ activeUserRole }} @@ -791,16 +797,18 @@ this.$refs["input-nick"].focus(); }, hideInputNick() { - this.showInputNickName = false; if (this.inputNickName == this.activeAccountItem.nickname) { + this.showInputNickName = false; return; } updateUser({ id: this.activeAccountItem.id, nickname: this.inputNickName, }).then((res) => { + this.activeAccountItem.nickname = this.inputNickName this.$message.success(res.msg); this.fetchUserList(true); + this.showInputNickName = false; }); }, openAccount(item, i) { @@ -1525,12 +1533,11 @@ align-items: baseline; min-width: 200px; .username { - margin: 4px 15px; - height: 30px; - line-height: 30px; - // width: 90px; - text-align: left; - font-size: 15px; + margin: 0 15px; + height: 28px; + line-height: 28px; + text-align: left; + font-size: 16px; display: flex; align-items: center; } @@ -1538,6 +1545,7 @@ margin: 5px 15px; font-size: 14px; display: flex; + height: 30px; align-items: center; .nick-text { width: fit-content; @@ -1554,9 +1562,9 @@ } .el-input--mini { font-size: 14px; - width: 100px; + width: 83px; .el-input__inner { - padding: 0 10px; + padding: 0 5px; } } } -- Gitblit v1.8.0