<template>
  <div>
    <el-table :data="globalFormData.pageVariable[options.dataKey]" style="width: 100%">
      <el-table-column :prop="i.keyName" :label="i.name" v-for="i in options.thTdMap" />
      <el-table-column label="操作">
        <template #default="scope">
          <el-button
            link
            type="primary"
            size="small"
            @click.prevent="updateBtn(scope)"
          >
            修改
          </el-button>
          <el-popconfirm title="确定要删除此项数据吗?" @confirm="delBtn(scope)">
            <template #reference>
              <el-button
                link
                type="primary"
                size="small"
              >
                删除
              </el-button>
            </template>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script lang="ts" setup>

defineOptions({
  name: 'hw-table-view'
});

const props = defineProps({
  options: Object
});

const { options } = toRefs(props);
const globalFormData = inject('globalFormData');
const updateBtn = (scope) => {
  console.log(scope);
};
const delBtn = (scope) => {
  console.log(scope.row);
};
</script>
<style scoped lang="less">
</style>



