Переглянути джерело

feat(userinfobind): the value is 0 when expanding, and the value is restored when collapsing

fenghao 3 роки тому
батько
коміт
316a8c856a

+ 3 - 2
src/views/platform/profile/components/UserInfoItem.vue

@@ -9,20 +9,21 @@
           v-model="cValue"
           :maxlength="config.maxlength"
           :placeholder="'请输入'+config.tipText"
+          :readonly="!expanded"
         />
       </div>
       <div class="c-line__right has-left-padding">
         <button
           v-if="expanded === false"
           class="o-button"
-          @click="expanded = true"
+          @click="(cValue = '',expanded = true)"
         >
           {{ initial?'更换':'绑定' }}{{ config.label }}
         </button>
         <div
           v-else
           class="u-pointer u-color--blue"
-          @click="expanded = false"
+          @click="(cValue =initial,expanded = false)"
         >
           收起
         </div>

+ 1 - 1
src/views/platform/profile/index.vue

@@ -61,7 +61,7 @@
             @update="updateUser({email}, '更新邮箱')"
           />
         </div>
-        <div class="l-flex--row has-top-padding">
+        <div class="l-flex--row center has-top-padding">
           <div class="o-app">
             <i class="o-icon wechat has-bg" />
             <template v-if="wechat">