<template>
  <div>
    <span>
      <el-input v-model="attributeValue.value" :placeholder="placeholder"></el-input>
    </span>
  </div>
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
import { Prop } from "vue-property-decorator";
import { Attribute } from "@/model/Element";
import { AttributeValue } from "@/model/Attribute";
import SwtionElement from "@/plugins/element";
import SwtionAttribute from "@/plugins/attribute";
@Options({})
export default class scInput extends Vue {
  @Prop({
    default: new AttributeValue(),
  })
  public attributeValue?: any;
  // @Prop({
  //   default: "0",
  //   type: String,
  // })
  // public elementId!: string;
  // @Prop({
  //   default: "self",
  //   type: String,
  // })
  // public type!: keyof Attribute;
  @Prop({
    default: "请输入",
    type: String,
  })
  public placeholder?: string;
  // @Prop({
  //   default: "",
  // })
  // public initValue?: any;
  // public swtionEle = new SwtionElement();
  // public swtionAttr = new SwtionAttribute();
  // public value = "";
  created() {
    // console.log(this.attributeValue)
    // if (!this.initValue) {
    //   let node = this.swtionEle.findTreeNode(this.elementId);
    //   let attributeList = node.attribute[this.type];
    //   this.value = this.swtionAttr.findAttributeValueById(
    //     this.attributeValue ? this.attributeValue.id : "0",
    //     attributeList
    //   );
    // } else {
    //   this.value = this.initValue;
    // }
  }
}
</script>
