index.js 799 B

1234567891011121314151617181920212223242526272829303132333435
  1. import Table from '../table'
  2. import VXETable from '../v-x-e-table'
  3. import ExportPanel from './src/export-panel'
  4. import ImportPanel from './src/import-panel'
  5. import mixin, { saveLocalFile, handlePrint } from './src/mixin'
  6. function print (options) {
  7. const opts = Object.assign({}, options, {
  8. type: 'html'
  9. })
  10. handlePrint(null, opts, opts.content)
  11. }
  12. export const Export = {
  13. install (Vue) {
  14. VXETable.reg('export')
  15. VXETable.saveFile = saveLocalFile
  16. VXETable.print = print
  17. VXETable.setup({
  18. export: {
  19. types: {
  20. csv: 0,
  21. html: 0,
  22. xml: 0,
  23. txt: 0
  24. }
  25. }
  26. })
  27. Table.mixins.push(mixin)
  28. Vue.component(ExportPanel.name, ExportPanel)
  29. Vue.component(ImportPanel.name, ImportPanel)
  30. }
  31. }
  32. export default Export