Prechádzať zdrojové kódy

fix: [模板管理]当没有预览图时按钮disable

louhangfei 1 rok pred
rodič
commit
eef21c3b82
1 zmenil súbory, kde vykonal 13 pridanie a 5 odobranie
  1. 13 5
      src/views/templateManage/CardCommon.vue

+ 13 - 5
src/views/templateManage/CardCommon.vue

@@ -24,9 +24,7 @@
     />
 
     <div class="body">
-      <el-button type="primary" :icon="Plus" @click="addForm" style="margin-bottom: 16px">
-        添加模板</el-button
-      >
+      <el-button type="primary" :icon="Plus" @click="addForm" style="margin-bottom: 16px"> 添加模板</el-button>
       <el-table style="width: 100%" :data="tableData" highlight-current-row>
         <el-table-column label="模板名称" prop="name" min-width="16%" />
         <!-- <el-table-column :label="props.type + `代码`" prop="code" /> -->
@@ -62,8 +60,18 @@
             />
           </template> -->
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="showPreview(scope.row)"
-              ><el-tooltip class="box-item" effect="dark" content="预览" placement="top">
+            <el-button
+              link
+              type="primary"
+              size="small"
+              @click="showPreview(scope.row)"
+              :disabled="!scope.row.previewImage"
+              ><el-tooltip
+                class="box-item"
+                effect="dark"
+                :content="scope.row.previewImage ? '预览' : '暂无预览图'"
+                placement="top"
+              >
                 <el-icon :size="16">
                   <View />
                 </el-icon>