Prechádzať zdrojové kódy

隐藏按钮块

v-if密码正确再渲染
JunboXu 3 rokov pred
rodič
commit
01cb114850
1 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 5 5
      src/components/Notice/Notice.vue

+ 5 - 5
src/components/Notice/Notice.vue

@@ -5,8 +5,8 @@
         <div-header :header="'大赛通知'" class="notice-header-title">
         </div-header>
         <div>
-          <Input type="password" v-model="inputPassword" placeholder="请输入内容" size="small" class="add-notice-password"></Input>
-          <Button type="primary" plain class="add-notice" @click="handleAddNotice" :disabled="enableAddNotice">添加通知
+          <Input type="password" v-model="inputPassword" placeholder="请输入验证码添加通知" size="small" class="add-notice-password"></Input>
+          <Button type="primary" plain class="add-notice" @click="handleAddNotice" v-if="enableAddNotice">添加通知
           </Button>
         </div>
       </div>
@@ -141,7 +141,7 @@
         </div-header>
         <div>
           <Input v-model="inputPassword" placeholder="请输入内容" size="small" class="add-notice-password"></Input>
-          <Button type="primary" plain class="add-notice" @click="handleAddNotice" :disabled="enableAddNotice">添加通知
+          <Button v-if="enableAddNotice" type="primary" plain class="add-notice" @click="handleAddNotice" >添加通知
           </Button>
         </div>
       </div>
@@ -297,7 +297,7 @@
     },
     data() {
       return {
-        enableAddNotice: true,
+        enableAddNotice: false,
         inputPassword: '',
         noticeList:[]
       }
@@ -329,7 +329,7 @@
         if(newVal&&newVal!==oldVal){
           axios.get(`/api/checkPWD/${newVal}`).then(res=>{
             // console.log(res);            
-            this.enableAddNotice = !res.data
+            this.enableAddNotice = res.data
           })
         }
       }