ソースを参照

修复字典组件值为整形不显示问题

RuoYi 4 年 前
コミット
40bdf7b100
共有1 個のファイルを変更した3 個の追加3 個の削除を含む
  1. 3 3
      ruoyi-ui/src/components/DictTag/index.vue

+ 3 - 3
ruoyi-ui/src/components/DictTag/index.vue

@@ -31,12 +31,12 @@ export default {
31 31
       type: Array,
32 32
       default: null,
33 33
     },
34
-    value: [String, Array],
34
+    value: [Number, String, Array],
35 35
   },
36 36
   computed: {
37 37
     values() {
38
-      if (this.value) {
39
-        return Array.isArray(this.value) ? this.value : [this.value];
38
+      if (this.value !== null && typeof this.value !== 'undefined') {
39
+        return Array.isArray(this.value) ? this.value : [String(this.value)];
40 40
       } else {
41 41
         return [];
42 42
       }