<template>
  <div class="header-setting">
    <el-input v-model="form.name" placeholder="请填写表头"></el-input>
    <div style="text-align:right; margin-top:20px;">
        <el-button type="warning" @click="btnSave">确认保存</el-button>
    </div>
  </div>
</template>

<script>
  export default{
    emits:['onSetHeader'],
    props:{
      headerItemName:{
        type:String,
        default:"",
      }
    },
    watch:{
       'headerItemName':{
         handler(val){
          if(val==undefined)return;
           this.form.name=val;
         },
         immediate:true,
         deep:true,
       }
    },
    data(){
     return {
       form:{
          name:"",
       }
     }
    },
    methods:{

      btnSave(e){
        let _this=this;
        _this.$emit("onSetHeader",_this.form.name);
        // console.log(_this.form.name);
      }
    }
  }
</script>


<style lang="scss">
@import './index.scss';
</style>
