<script>
export default {
  name: "FormatValue",
  props: {
    value: {
      type: [String, Number],
      require: true,
    },
    dicts: {
      type: Array,
      require: true,
    },
  },
  data() {
    return {};
  },
  computed: {
    innerValue: {
      get() {
        const { value, dicts } = this.$props;
        const item = dicts.find((dict) => dict.value === value);
        return item ? item.label : "";
      },
      set() {},
    },
  },
  methods: {},
  created() {},
};
</script>

<template>
  <span>{{ innerValue }}</span>
</template>
