<template>
  <a-input :type="type" :value="modelValue" @input="updateValue" :disabled="see || disabled || readonly"  :placeholder="placeholder" :style="style" v-bind="$attrs"/>
</template>

<script>
export default {
  name: "PaasInput",
  inheritAttrs: false, // 禁用自动继承，手动控制透传
  computed: {
    see() {
      return this.$store?.forms?.see || false;
    }
  },
  props: {
    placeholder: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: "text"
    },
    modelValue: {
      type: [String, Number, Object],
      default: ""
    },
    readonly: {
      type: Boolean,
      default: false
    },
    disabled: {
      type: Boolean,
      default: false
    },
    style: { type: [String, Object], default: "width: 100%;" }
  },
  emits: ["update:modelValue"],
  methods: {
    updateValue(event) {
      this.$emit("update:modelValue", event.target.value);
    }
  }
};
</script>