docs(grid/export): [grid] update export docs (#900)
This commit is contained in:
parent
f6a01396a4
commit
41b2b7d9ff
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
Grid as TinyGrid,
|
||||
|
|
@ -80,9 +80,14 @@ function clearDataEvent() {
|
|||
|
||||
function toCsvEvent() {
|
||||
theGridRef.value.exportCsv({
|
||||
// 文件名称
|
||||
filename: 'table.csv',
|
||||
original: true,
|
||||
// 是否导出表头
|
||||
isHeader: false,
|
||||
// 是否在每行后面添加制表符
|
||||
useTabs: false,
|
||||
// 导出的数据
|
||||
data: tableData.value
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
<script>
|
||||
import { Grid, GridColumn, GridToolbar, Button } from '@opentiny/vue'
|
||||
|
||||
export default {
|
||||
|
|
@ -83,9 +83,14 @@ export default {
|
|||
},
|
||||
toCsvEvent() {
|
||||
this.$refs.theGrid.exportCsv({
|
||||
// 文件名称
|
||||
filename: 'table.csv',
|
||||
original: true,
|
||||
// 是否导出表头
|
||||
isHeader: false,
|
||||
// 是否在每行后面添加制表符
|
||||
useTabs: false,
|
||||
// 导出的数据
|
||||
data: this.tableData
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,15 +129,6 @@ const downloadCsc = (options, content) => {
|
|||
|
||||
if (navigator.msSaveBlob && window.Blob) {
|
||||
navigator.msSaveBlob(new Blob([content], { type: 'text/csv;charset=utf-8' }), options.filename)
|
||||
} else if (browser.name === 'ie') {
|
||||
const win = window.top.open('about:blank', '_blank')
|
||||
|
||||
win.opener = null
|
||||
win.document.charset = 'utf-8'
|
||||
win.document.write(content)
|
||||
win.document.close()
|
||||
win.document.execCommand('SaveAs', options.filename)
|
||||
win.close()
|
||||
} else {
|
||||
const linkElem = document.createElement('a')
|
||||
|
||||
|
|
@ -159,7 +150,6 @@ const downloadCsc = (options, content) => {
|
|||
export default {
|
||||
_exportCsv(options) {
|
||||
let { visibleColumn, scrollXLoad, scrollYLoad, treeConfig } = this
|
||||
|
||||
let mergedOpts = {
|
||||
columns: null,
|
||||
columnFilterMethod: (column) => column.property && !['index', 'selection', 'radio'].includes(column.type),
|
||||
|
|
|
|||
Loading…
Reference in New Issue