export-button.vue 666 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div>
  3. <el-button size="mini" type="primary" :icon="isIcon ? 'el-icon-download' : ''" @click="handleExport">{{
  4. exText
  5. }}</el-button>
  6. </div>
  7. </template>
  8. <script>
  9. import { downloadFiles } from '@/utils/util'
  10. export default {
  11. name: 'ExportButton',
  12. props: {
  13. exText: {
  14. type: String,
  15. default: '导出数据'
  16. },
  17. isIcon: {
  18. type: Boolean,
  19. default: true
  20. },
  21. exUrl: {
  22. type: String,
  23. default: ''
  24. },
  25. exParams: {
  26. type: Object,
  27. default: null
  28. }
  29. },
  30. methods: {
  31. handleExport() {
  32. downloadFiles(this.exUrl, this.exParams)
  33. }
  34. }
  35. }
  36. </script>
  37. <style></style>