qinzhipeng_v@didiglobal.com 4 жил өмнө
parent
commit
0ee6200857

+ 3 - 1
src/views/monthly/components/createdMonthly.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog :title="title" :show="show" :visible.sync="monthly_show" width="60%" class="public_task" @close="$emit('update:show', false)">
+  <el-dialog :show="show" :title="title" :visible.sync="monthly_show" width="60%" class="public_task" @close="$emit('update:show', false)">
     <div class="blueStripe" />
     <el-form ref="monthly_form" :model="monthly_form" :rules="rules" label-position="left" label-width="80px">
       <el-form-item label="标题" prop="title">
@@ -67,12 +67,14 @@ export default {
     },
     handlePictureCardPreviewTow(file) {
       this.monthly_form.content = 'http:' + file.url
+      this.$refs.monthly_form.clearValidate('content')
     },
     handleRemove(file, fileList) {
       console.log(file, fileList)
     },
     handlePictureCardPreview(file) {
       this.monthly_form.thumb = 'http:' + file.url
+      this.$refs.monthly_form.clearValidate('thumb')
     }
   }
 }

+ 2 - 2
src/views/monthly/index.vue

@@ -23,7 +23,7 @@
       </el-aside>
       <el-main class="monthly-main">
         <div class="monthly-main-title">
-          <el-tooltip v-if="monthly_main_image.title.length > 12" class="item" effect="dark" :content="monthly_main_image.title" placement="top">
+          <el-tooltip v-if="monthly_main_image.title && monthly_main_image.title.length > 12" class="item" effect="dark" :content="monthly_main_image.title" placement="top">
             <div>{{ monthly_main_image.title | ellipsis }}</div>
           </el-tooltip>
           <div v-else>{{ monthly_main_image.title | ellipsis }}</div>
@@ -36,7 +36,7 @@
         </div>
       </el-main>
     </el-container>
-    <addMonthly :show.sync="show" :title="title" @monthly_created="monthly_created" />
+    <addMonthly v-if="show" :show.sync="show" :title="title" @monthly_created="monthly_created" />
   </el-container>
 </template>