<template>
  <div class="app-container">
    <el-button
      type="primary"
      plain
      size="mini"
      @click="examCourseAdd"
    >添加老师</el-button>
    <el-table
      :data="studyCenterTeacherList"
      style="width: 100%">
      <el-table-column prop="teacherName" label="老师名称" align="center">
        <template slot-scope="scope">
          <el-input v-model="scope.row.teacherName" placeholder="请输入内容"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="teacherPhone" label="老师电话" align="center">
        <template slot-scope="scope">
          <el-input v-model="scope.row.teacherPhone" placeholder="请输入内容"></el-input>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="examCourseDelete(scope.row, scope.$index)"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>

<script>

export default {
  name: "StudyCenterTeacher",
  props: {
    value: [Array],
    studyCenterTeacherList: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
    };
  },
  created() {
  },
  methods: {
    examCourseAdd(){
      let data = {
        teacherName:null,
        teacherPhone:null,
      }
      this.studyCenterTeacherList.push(data);
    },
    examCourseDelete(row, index){
      this.studyCenterTeacherList.splice(index, 1);
    },
  }
};
</script>
