<template>
  <el-button
    type="primary"
    size="small"
    icon="el-icon-download"
    @click="exportFn"
    >{{btnName}}</el-button
  >
</template>

<script>
  import { exportTable } from '@/api/system/file/index.js';
  export default {
    props: {
      btnName: {
        type: String,
        default: '导出'
      },
      apiUrl: '',
      fileName: '',
      params: {
        default: () => {
          return {};
        }
      }
    },
    //注册组件
    data() {
      return {};
    },

    created() {},
    methods: {
      exportFn() {
        exportTable({
          api: this.apiUrl,
          fileName: this.fileName,
          data:this.params
        });
      }
    }
  };
</script>

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