使用vxeTable时的导出和打印功能

参考

Vxe UI v3 Plugins

安装命令

npm install [email protected] [email protected] @vxe-ui/[email protected] [email protected]

在main.js文件中

import 
	VxeUI
 from 'vxe-pc-ui'
import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
import ExcelJS from 'exceljs'
import 'vxe-pc-ui/lib/style.css'
// Vue.use(VxeUIAll)
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'
VxeUI.use(VxeUIPluginExportXLSX, {
   
	ExcelJS
})

Vue.use(VxeUI)
Vue.use(VxeUITable)

VxeUITable.setup({
   
	size: "mini",
})

在使用vxetable的vue文件中

<div>
						<vxe-toolbar perfect style="width: 40.5rem;">
							<template #buttons>
								<vxe-button type="text" @click="exportDataEvent('xTable1')" icon="vxe-icon--download"
									content="导出">vxe-button>
								<vxe-button @click="

你可能感兴趣的:(vue.js,前端,javascript)