فهرست منبع

fix 修复el-tag标签类型不一致问题

LiuHao 1 سال پیش
والد
کامیت
9967a72e24
3فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 1 3
      src/components/DictTag/index.vue
  2. 1 1
      src/types/element.d.ts
  3. 1 1
      src/views/system/dict/data.vue

+ 1 - 3
src/components/DictTag/index.vue

@@ -15,7 +15,7 @@
           :key="item.value + ''"
           :disable-transitions="true"
           :index="index"
-          :type="item.elTagType === 'primary' || item.elTagType === 'default' ? '' : item.elTagType"
+          :type="item.elTagType === 'primary' || item.elTagType === 'default' ? 'primary' : item.elTagType"
           :class="item.elTagClass"
         >
           {{ item.label + ' ' }}
@@ -29,8 +29,6 @@
 </template>
 
 <script setup lang="ts">
-import { propTypes } from '@/utils/propTypes';
-
 interface Props {
   options: Array<DictDataOption>;
   value: number | string | Array<number | string>;

+ 1 - 1
src/types/element.d.ts

@@ -1,6 +1,6 @@
 import type * as ep from 'element-plus';
 declare global {
-  declare type ElTagType = 'success' | 'info' | 'warning' | 'danger' | '';
+  declare type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger';
   declare type ElFormInstance = ep.FormInstance;
   declare type ElTableInstance = ep.TableInstance;
   declare type ElUploadInstance = ep.UploadInstance;

+ 1 - 1
src/views/system/dict/data.vue

@@ -169,7 +169,7 @@ const initFormData: DictDataForm = {
   dictLabel: '',
   dictValue: '',
   cssClass: '',
-  listClass: '',
+  listClass: 'primary',
   dictSort: 0,
   remark: ''
 };