<template>
  <div>
    <el-input v-model="nodeName" @change="saveName"></el-input>
  </div>
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
import { Prop } from "vue-property-decorator";
import SwtionProcess from "@/plugins/process";
import { process } from "@/model/Process";
import { calc } from "@/model/Calc";
@Options({})
export default class layout extends Vue {
  @Prop({
    default: new process(),
  })
  public node!: IProcess | ICalc;
  public nodeName = "";
  created() {
    this.initName();
  }
  public initName(name?: string) {
    name = name !== null && name !== undefined ? name : this.node.name;
    this.nodeName = name;
  }
  public saveName() {
    const swtionProc = new SwtionProcess();
    swtionProc.changeName(this.node.id, this.nodeName);
    this.$emit("save", this.nodeName);
  }
}
</script>

<style lang="scss"></style>