Browse Source

fix: 更改名字中的占位字段更正

ChenYangfan 6 years ago
parent
commit
9afe573bbe
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/views/teacher/tabs/TeacherPersonal.vue

+ 7 - 1
src/views/teacher/tabs/TeacherPersonal.vue

@@ -2,7 +2,7 @@
   <div class="tab">
     <h1 class="title">个人信息设置 <span class="tag">教师</span></h1>
     <div class="sub-title">修改姓名</div>
-    <c-input placeholder="姓名" class="mb-16" v-model="newName"></c-input>
+    <c-input :placeholder="'目前资料中的姓名:' + userInfo.name" class="mb-16" v-model="newName"></c-input>
     <c-button class="warning full-width mb-32" @click="handleModifyName">确认修改姓名</c-button>
     <div class="sub-title">修改密码</div>
     <div class="verified-code-wrapper">
@@ -23,6 +23,7 @@ import CButton from '@/components/CButton'
 import CInput from '@/components/CInput'
 import { sendEmailCode } from '@/server/code'
 import { logout, modifyUser, resetPasswordByEmail } from '@/server/user'
+import { mapState } from 'vuex'
 
 export default {
   components: { CInput, CButton },
@@ -35,6 +36,11 @@ export default {
       passwordEnsure: ''
     }
   },
+  computed: {
+    ...mapState({
+      userInfo: state => state.main.userInfo
+    })
+  },
   methods: {
     handleSendEmailCode () {
       this.$showMessage({ message: '正在尝试发送验证码', type: 'info' })