<template>
  <!-- <span v-on="$listeners">{{ innerValue || "--" }}</span> -->
  <span v-on="$listeners">{{ innerValue }}</span>
</template>

<script>
export default {
  name: "ComputedInputV2",
  props: {
    // v-model
    value: {
      type: [Number, String],
      require: true,
    },
    // formatter
    formatter: {
      type: Function,
      default: () => {},
      require: true,
    },
    // formatter
    source: {
      type: Object,
    },
  },
  data() {
    return {};
  },
  computed: {
    innerValue: {
      get() {
        return this.formatter(this.source || this.value);
      },
    },
  },
  watch: {},
  methods: {},
  created() {},
  mounted() {},
  destroyed() {},
};
</script>
<style scoped></style>
