mirror of
https://gitee.com/xuliangzhan_admin/vxe-table.git
synced 2026-01-21 05:27:57 +08:00
增加参数 row-config.height
This commit is contained in:
@@ -453,6 +453,13 @@ export default {
|
||||
},
|
||||
keywords: ['max-height']
|
||||
},
|
||||
{
|
||||
label: 'app.aside.nav.rowHeight',
|
||||
locat: {
|
||||
name: 'TableRowHeight'
|
||||
},
|
||||
keywords: ['row-config', 'height']
|
||||
},
|
||||
{
|
||||
label: 'app.aside.nav.resize',
|
||||
locat: {
|
||||
|
||||
@@ -925,7 +925,7 @@ const apis = [
|
||||
list: [
|
||||
{
|
||||
name: 'width',
|
||||
desc: '列的默认宽度',
|
||||
desc: '列的宽度',
|
||||
version: '',
|
||||
type: 'number, string',
|
||||
enum: 'auto, px, %',
|
||||
@@ -934,7 +934,7 @@ const apis = [
|
||||
},
|
||||
{
|
||||
name: 'minWidth',
|
||||
desc: '列的默认最小宽度',
|
||||
desc: '列的最小宽度',
|
||||
version: '',
|
||||
type: 'number, string',
|
||||
enum: 'auto, px, %',
|
||||
@@ -943,6 +943,25 @@ const apis = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'row-config',
|
||||
desc: '行配置信息',
|
||||
version: '3.3.17',
|
||||
type: 'any',
|
||||
enum: '',
|
||||
defVal: '继承 setup.table.rowConfig',
|
||||
list: [
|
||||
{
|
||||
name: 'height',
|
||||
desc: '只对 show-overflow 有效,行的高度',
|
||||
version: '',
|
||||
type: 'number',
|
||||
enum: '',
|
||||
defVal: '',
|
||||
list: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'resizable-config',
|
||||
descKey: 'app.api.table.desc.resizableConfig',
|
||||
|
||||
@@ -132,7 +132,7 @@ export default {
|
||||
scrollMode: 'Scroll mode',
|
||||
scrollRows: 'vertical',
|
||||
scrollFullRows: 'vertical + complicated',
|
||||
scrollCols: 'horizontal and vertical',
|
||||
scrollCols: 'horizontal',
|
||||
scrollFullCols: 'horizontal and vertical + complicated',
|
||||
moveHighlight: 'Keyboard move highlight row',
|
||||
scrollTree: 'Virtual tree',
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
scrollMode: '滚动模式',
|
||||
scrollRows: '纵向',
|
||||
scrollFullRows: '纵向 + 复杂渲染',
|
||||
scrollCols: '横向&纵向',
|
||||
scrollCols: '横向',
|
||||
scrollFullCols: '横向&纵向 + 复杂渲染',
|
||||
moveHighlight: '键盘移动高亮行',
|
||||
scrollTree: '虚拟树',
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
scrollMode: '滚动模式',
|
||||
scrollRows: '纵向',
|
||||
scrollFullRows: '纵向 + 复杂渲染',
|
||||
scrollCols: '横向&纵向',
|
||||
scrollCols: '横向',
|
||||
scrollFullCols: '横向&纵向 + 复杂渲染',
|
||||
moveHighlight: '键盘移动高亮行',
|
||||
scrollTree: '虚拟树',
|
||||
|
||||
@@ -39,6 +39,7 @@ import TableHeaderHighlight from './views/table/base/HeaderHighlight.vue'
|
||||
import TableResizable from './views/table/base/Resizable.vue'
|
||||
import TableMaxHeight from './views/table/base/MaxHeight.vue'
|
||||
import TableHeight from './views/table/base/Height.vue'
|
||||
import TableRowHeight from './views/table/base/RowHeight.vue'
|
||||
import TableAutoHeight from './views/table/base/AutoHeight.vue'
|
||||
import TableFixed from './views/table/base/Fixed.vue'
|
||||
import TableFixedFull from './views/table/base/FixedFull.vue'
|
||||
@@ -488,6 +489,11 @@ export default new Router({
|
||||
name: 'TableHeight',
|
||||
component: TableHeight
|
||||
},
|
||||
{
|
||||
path: '/table/base/rowHeight',
|
||||
name: 'TableRowHeight',
|
||||
component: TableRowHeight
|
||||
},
|
||||
{
|
||||
path: '/table/base/autoHeight',
|
||||
name: 'TableAutoHeight',
|
||||
|
||||
@@ -89,50 +89,50 @@ import switchAPI from '../../api/switch'
|
||||
import listAPI from '../../api/list'
|
||||
import pulldownAPI from '../../api/pulldown'
|
||||
|
||||
// import i18n from '../../i18n'
|
||||
// const attributes = window.attributes = {}
|
||||
// const tags = window.tags = {}
|
||||
import i18n from '../../i18n'
|
||||
const attributes = window.attributes = {}
|
||||
const tags = window.tags = {}
|
||||
|
||||
// const tagMaps = [
|
||||
// ['vxe-table', tableAPI, { subtags: ['vxe-colgroup', 'vxe-column'], description: '基础表格' }],
|
||||
// ['vxe-colgroup', colgroupAPI, { subtags: ['vxe-column'], description: '基础表格 - 分组列' }],
|
||||
// ['vxe-column', columnAPI, { description: '基础表格 - 列' }],
|
||||
// ['vxe-grid', gridAPI, { description: '高级表格' }],
|
||||
// ['vxe-toolbar', toolbarAPI, { description: '工具栏' }],
|
||||
// ['vxe-pager', pagerAPI, { description: '分页' }],
|
||||
// ['vxe-radio', radioAPI, { description: '单选框' }],
|
||||
// ['vxe-radio-group', radioGroupAPI, { subtags: ['vxe-radio', 'vxe-radio-button'], description: '单选组' }],
|
||||
// ['vxe-radio-button', radioButtonAPI, { description: '单选按钮' }],
|
||||
// ['vxe-checkbox', checkboxAPI, { description: '复选框' }],
|
||||
// ['vxe-checkbox-group', checkboxGroupAPI, { subtags: ['vxe-checkbox'], description: '复选组' }],
|
||||
// ['vxe-switch', switchAPI, { description: '开关按钮' }],
|
||||
// ['vxe-input', inputAPI, { description: '输入框' }],
|
||||
// ['vxe-select', selectAPI, { subtags: ['vxe-optgroup', 'vxe-option'], description: '下拉框' }],
|
||||
// ['vxe-optgroup', optgroupAPI, { subtags: ['vxe-option'], description: '下拉框 - 分组' }],
|
||||
// ['vxe-option', optionAPI, { description: '下拉框 - 选项' }],
|
||||
// ['vxe-button', buttonAPI, { description: '按钮' }],
|
||||
// ['vxe-tooltip', tooltipAPI, { description: '工具提示' }],
|
||||
// ['vxe-modal', modalAPI, { description: '弹窗' }],
|
||||
// ['vxe-form', formAPI, { subtags: ['vxe-form-item'], description: '表单' }],
|
||||
// ['vxe-form-item', formItemAPI, { description: '表单 - 项' }],
|
||||
// ['vxe-form-gather', formGatherAPI, { description: '表单 - 项集合' }],
|
||||
// ['vxe-list', listAPI, { description: '列表' }],
|
||||
// ['vxe-pulldown', pulldownAPI, { description: '下拉容器' }]
|
||||
// ]
|
||||
const tagMaps = [
|
||||
['vxe-table', tableAPI, { subtags: ['vxe-colgroup', 'vxe-column'], description: '基础表格' }],
|
||||
['vxe-colgroup', colgroupAPI, { subtags: ['vxe-column'], description: '基础表格 - 分组列' }],
|
||||
['vxe-column', columnAPI, { description: '基础表格 - 列' }],
|
||||
['vxe-grid', gridAPI, { description: '高级表格' }],
|
||||
['vxe-toolbar', toolbarAPI, { description: '工具栏' }],
|
||||
['vxe-pager', pagerAPI, { description: '分页' }],
|
||||
['vxe-radio', radioAPI, { description: '单选框' }],
|
||||
['vxe-radio-group', radioGroupAPI, { subtags: ['vxe-radio', 'vxe-radio-button'], description: '单选组' }],
|
||||
['vxe-radio-button', radioButtonAPI, { description: '单选按钮' }],
|
||||
['vxe-checkbox', checkboxAPI, { description: '复选框' }],
|
||||
['vxe-checkbox-group', checkboxGroupAPI, { subtags: ['vxe-checkbox'], description: '复选组' }],
|
||||
['vxe-switch', switchAPI, { description: '开关按钮' }],
|
||||
['vxe-input', inputAPI, { description: '输入框' }],
|
||||
['vxe-select', selectAPI, { subtags: ['vxe-optgroup', 'vxe-option'], description: '下拉框' }],
|
||||
['vxe-optgroup', optgroupAPI, { subtags: ['vxe-option'], description: '下拉框 - 分组' }],
|
||||
['vxe-option', optionAPI, { description: '下拉框 - 选项' }],
|
||||
['vxe-button', buttonAPI, { description: '按钮' }],
|
||||
['vxe-tooltip', tooltipAPI, { description: '工具提示' }],
|
||||
['vxe-modal', modalAPI, { description: '弹窗' }],
|
||||
['vxe-form', formAPI, { subtags: ['vxe-form-item'], description: '表单' }],
|
||||
['vxe-form-item', formItemAPI, { description: '表单 - 项' }],
|
||||
['vxe-form-gather', formGatherAPI, { description: '表单 - 项集合' }],
|
||||
['vxe-list', listAPI, { description: '列表' }],
|
||||
['vxe-pulldown', pulldownAPI, { description: '下拉容器' }]
|
||||
]
|
||||
|
||||
// tagMaps.forEach(confs => {
|
||||
// const props = confs[1].find(item => item.name === 'Props').list
|
||||
// const keys = []
|
||||
// props.forEach(item => {
|
||||
// const name = XEUtils.kebabCase(item.name)
|
||||
// attributes[`${confs[0]}/${name}`] = {
|
||||
// type: XEUtils.toValueString(item.type).toLowerCase(),
|
||||
// description: item.descKey ? i18n.t(item.descKey) : item.desc
|
||||
// }
|
||||
// keys.push(name)
|
||||
// })
|
||||
// tags[confs[0]] = Object.assign({ attributes: keys }, confs[2])
|
||||
// })
|
||||
tagMaps.forEach(confs => {
|
||||
const props = confs[1].find(item => item.name === 'Props').list
|
||||
const keys = []
|
||||
props.forEach(item => {
|
||||
const name = XEUtils.kebabCase(item.name)
|
||||
attributes[`${confs[0]}/${name}`] = {
|
||||
type: XEUtils.toValueString(item.type).toLowerCase(),
|
||||
description: item.descKey ? i18n.t(item.descKey) : item.desc
|
||||
}
|
||||
keys.push(name)
|
||||
})
|
||||
tags[confs[0]] = Object.assign({ attributes: keys }, confs[2])
|
||||
})
|
||||
|
||||
export default {
|
||||
data () {
|
||||
|
||||
116
examples/views/table/base/RowHeight.vue
Normal file
116
examples/views/table/base/RowHeight.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div>
|
||||
<p class="tip">虚拟滚动启用后需要等行高,可以通过 <table-api-link prop="row-config"/>.height 修改行的高度</p>
|
||||
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
show-overflow
|
||||
height="500"
|
||||
:row-config="{height: 120}"
|
||||
:data="tableData">
|
||||
<vxe-column type="seq" title="序号" width="100"></vxe-column>
|
||||
<vxe-column title="图片" width="140" align="center">
|
||||
<template #default>
|
||||
<img src="/vxe-table/static/other/img1.gif" style="width: 100px;">
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="基本信息">
|
||||
<template #default="{ row }">
|
||||
<div class="label-ellipsis">{{ row.name }}</div>
|
||||
<div class="label-ellipsis">{{ row.age }}</div>
|
||||
<div class="label-ellipsis">{{ row.address }}</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="role" title="Role" width="200"></vxe-column>
|
||||
<vxe-column field="address" title="Address" width="200"></vxe-column>
|
||||
</vxe-table>
|
||||
|
||||
<p class="demo-code">{{ $t('app.body.button.showCode') }}</p>
|
||||
|
||||
<pre>
|
||||
<pre-code class="xml">{{ demoCodes[0] }}</pre-code>
|
||||
<pre-code class="javascript">{{ demoCodes[1] }}</pre-code>
|
||||
<pre-code class="css">{{ demoCodes[1] }}</pre-code>
|
||||
</pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
tableData: [
|
||||
{ id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
|
||||
{ id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
|
||||
{ id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 23, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10005, name: 'Test5', role: 'Develop', sex: 'Women', age: 30, address: 'Shanghai' },
|
||||
{ id: 10006, name: 'Test6', role: 'Designer', sex: 'Women', age: 21, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10007, name: 'Test7', role: 'Test', sex: 'Man', age: 29, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10008, name: 'Test8', role: 'Develop', sex: 'Man', age: 35, address: 'vxe-table 从入门到放弃' }
|
||||
],
|
||||
demoCodes: [
|
||||
`
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
show-overflow
|
||||
height="500"
|
||||
:row-config="{height: 120}"
|
||||
:data="tableData">
|
||||
<vxe-column type="seq" title="序号" width="100"></vxe-column>
|
||||
<vxe-column title="图片" width="140" align="center">
|
||||
<template #default>
|
||||
<img src="/vxe-table/static/other/img1.gif" style="width: 100px;">
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="基本信息">
|
||||
<template #default="{ row }">
|
||||
<div class="label-ellipsis">{{ row.name }}</div>
|
||||
<div class="label-ellipsis">{{ row.age }}</div>
|
||||
<div class="label-ellipsis">{{ row.address }}</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="role" title="Role" width="200"></vxe-column>
|
||||
<vxe-column field="address" title="Address" width="200"></vxe-column>
|
||||
</vxe-table>
|
||||
`,
|
||||
`
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
tableData: [
|
||||
{ id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
|
||||
{ id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
|
||||
{ id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 23, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10005, name: 'Test5', role: 'Develop', sex: 'Women', age: 30, address: 'Shanghai' },
|
||||
{ id: 10006, name: 'Test6', role: 'Designer', sex: 'Women', age: 21, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10007, name: 'Test7', role: 'Test', sex: 'Man', age: 29, address: 'vxe-table 从入门到放弃' },
|
||||
{ id: 10008, name: 'Test8', role: 'Develop', sex: 'Man', age: 35, address: 'vxe-table 从入门到放弃' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
`
|
||||
.label-ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
`
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.label-ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<p class="tip">虚拟滚动启用后需要等行高,可以通过 <table-api-link prop="scroll-x"/>.rHeight 修改所有行的高度</p>
|
||||
<p class="tip">虚拟滚动启用后需要等行高,可以通过 <table-api-link prop="row-config"/>.height 修改行的高度</p>
|
||||
|
||||
<vxe-table
|
||||
border
|
||||
@@ -8,7 +8,8 @@
|
||||
show-overflow
|
||||
ref="xTable"
|
||||
height="500"
|
||||
:scroll-y="{gt: 0, rHeight: 120}"
|
||||
:row-config="{height: 120}"
|
||||
:scroll-y="{gt: 0}"
|
||||
:loading="loading">
|
||||
<vxe-column type="seq" title="序号" width="100"></vxe-column>
|
||||
<vxe-column title="图片" width="140" align="center">
|
||||
@@ -50,10 +51,11 @@ export default {
|
||||
show-overflow
|
||||
ref="xTable"
|
||||
height="500"
|
||||
:scroll-y="{gt: 0, rHeight: 120}"
|
||||
:row-config="{height: 120}"
|
||||
:scroll-y="{gt: 0}"
|
||||
:loading="loading">
|
||||
<vxe-column type="seq" title="序号" width="100"></vxe-column>
|
||||
<vxe-column title="图片" width="120" align="center">
|
||||
<vxe-column title="图片" width="140" align="center">
|
||||
<template #default>
|
||||
<img src="/vxe-table/static/other/img1.gif" style="width: 100px;">
|
||||
</template>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
:toolbar-config="{slots: {buttons: 'toolbar_buttons'}}"
|
||||
:checkbox-config="{checkField: 'checked'}">
|
||||
<template #toolbar_buttons>
|
||||
<vxe-button @click="loadColumnAndData(1000, 5000)">1k列5k条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 10000)">1k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 50000)">5k列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 100000)">5k列10w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 20)">1k列20条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 100)">1k列100条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 500)">5k列500条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 10000)">5k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 50000)">1w列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 100000)">1w列10w条</vxe-button>
|
||||
</template>
|
||||
@@ -53,10 +53,10 @@ export default {
|
||||
:toolbar-config="{slots: {buttons: 'toolbar_buttons'}}"
|
||||
:checkbox-config="{checkField: 'checked'}">
|
||||
<template #toolbar_buttons>
|
||||
<vxe-button @click="loadColumnAndData(1000, 5000)">1k列5k条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 10000)">1k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 50000)">5k列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 100000)">5k列10w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 20)">1k列20条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 100)">1k列100条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 500)">5k列500条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 10000)">5k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 50000)">1w列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 100000)">1w列10w条</vxe-button>
|
||||
</template>
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadColumnAndData(600, 600)
|
||||
this.loadColumnAndData(600, 10)
|
||||
},
|
||||
methods: {
|
||||
loadColumnAndData (colSize, rowSize) {
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadColumnAndData(600, 600)
|
||||
this.loadColumnAndData(600, 10)
|
||||
},
|
||||
methods: {
|
||||
loadColumnAndData (colSize, rowSize) {
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
:toolbar-config="{slots: {buttons: 'toolbar_buttons'}}"
|
||||
:checkbox-config="{checkField: 'checked', labelField: 'name'}">
|
||||
<template #toolbar_buttons>
|
||||
<vxe-button @click="loadColumnAndData(1000, 5000)">1k列5k条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 10000)">1k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 50000)">5k列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 100000)">5k列10w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(50, 20)">50列20条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(100, 50)">100列50条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(200, 100)">200列100条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 10000)">5k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 50000)">1w列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 100000)">1w列10w条</vxe-button>
|
||||
<vxe-button @click="$refs.xGrid.setAllCheckboxRow(true)">所有选中</vxe-button>
|
||||
@@ -75,10 +75,10 @@ export default {
|
||||
:toolbar-config="{slots: {buttons: 'toolbar_buttons'}}"
|
||||
:checkbox-config="{checkField: 'checked', labelField: 'name'}">
|
||||
<template #toolbar_buttons>
|
||||
<vxe-button @click="loadColumnAndData(1000, 5000)">1k列5k条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(1000, 10000)">1k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 50000)">5k列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 100000)">5k列10w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(50, 20)">50列20条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(100, 50)">100列50条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(200, 100)">200列100条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(5000, 10000)">5k列1w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 50000)">1w列5w条</vxe-button>
|
||||
<vxe-button @click="loadColumnAndData(10000, 100000)">1w列10w条</vxe-button>
|
||||
<vxe-button @click="$refs.xGrid.setAllCheckboxRow(true)">所有选中</vxe-button>
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadColumnAndData(600, 600)
|
||||
this.loadColumnAndData(20, 20)
|
||||
},
|
||||
methods: {
|
||||
loadColumnAndData (colSize, rowSize) {
|
||||
@@ -190,7 +190,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadColumnAndData(600, 600)
|
||||
this.loadColumnAndData(20, 20)
|
||||
},
|
||||
methods: {
|
||||
loadColumnAndData (colSize, rowSize) {
|
||||
|
||||
@@ -183,6 +183,10 @@
|
||||
"type": "any",
|
||||
"description": "列的默认参数"
|
||||
},
|
||||
"vxe-table/row-config": {
|
||||
"type": "any",
|
||||
"description": "行配置信息"
|
||||
},
|
||||
"vxe-table/resizable-config": {
|
||||
"type": "object",
|
||||
"description": "列宽拖动配置项"
|
||||
@@ -675,6 +679,10 @@
|
||||
"type": "any",
|
||||
"description": "列的默认参数"
|
||||
},
|
||||
"vxe-grid/row-config": {
|
||||
"type": "any",
|
||||
"description": "行配置信息"
|
||||
},
|
||||
"vxe-grid/resizable-config": {
|
||||
"type": "object",
|
||||
"description": "列宽拖动配置项"
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"row-id",
|
||||
"keep-source",
|
||||
"column-config",
|
||||
"row-config",
|
||||
"resizable-config",
|
||||
"seq-config",
|
||||
"sort-config",
|
||||
@@ -192,6 +193,7 @@
|
||||
"row-id",
|
||||
"keep-source",
|
||||
"column-config",
|
||||
"row-config",
|
||||
"resizable-config",
|
||||
"seq-config",
|
||||
"sort-config",
|
||||
|
||||
@@ -174,10 +174,10 @@ export default {
|
||||
loading: Boolean,
|
||||
data: Object,
|
||||
size: { type: String, default: () => GlobalConfig.form.size || GlobalConfig.size },
|
||||
span: [String, Number],
|
||||
span: { type: [String, Number], default: () => GlobalConfig.form.span },
|
||||
align: { type: String, default: () => GlobalConfig.form.align },
|
||||
titleAlign: { type: String, default: () => GlobalConfig.form.titleAlign },
|
||||
titleWidth: [String, Number],
|
||||
titleWidth: { type: [String, Number], default: () => GlobalConfig.form.titleWidth },
|
||||
titleColon: { type: Boolean, default: () => GlobalConfig.form.titleColon },
|
||||
titleAsterisk: { type: Boolean, default: () => GlobalConfig.form.titleAsterisk },
|
||||
titleOverflow: { type: [Boolean, String], default: null },
|
||||
|
||||
@@ -72,11 +72,13 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
||||
validOpts,
|
||||
editStore,
|
||||
validStore,
|
||||
tooltipConfig
|
||||
tooltipConfig,
|
||||
rowOpts
|
||||
} = $xetable
|
||||
const { type, cellRender, editRender, align, showOverflow, className, treeNode } = column
|
||||
const { actived } = editStore
|
||||
const { rHeight } = sYOpts
|
||||
const { rHeight: scrollYRHeight } = sYOpts
|
||||
const { height: rowHeight } = rowOpts
|
||||
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled
|
||||
const columnIndex = $xetable.getColumnIndex(column)
|
||||
const _columnIndex = $xetable.getVTColumnIndex(column)
|
||||
@@ -204,7 +206,7 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
||||
'c--ellipsis': showEllipsis
|
||||
}],
|
||||
style: {
|
||||
maxHeight: hasEllipsis && rHeight ? `${rHeight}px` : ''
|
||||
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -219,7 +221,7 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
||||
'c--ellipsis': showEllipsis
|
||||
}],
|
||||
style: {
|
||||
maxHeight: hasEllipsis && rHeight ? `${rHeight}px` : ''
|
||||
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
||||
},
|
||||
attrs: {
|
||||
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
||||
@@ -258,7 +260,7 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
||||
key: columnKey ? column.id : $columnIndex,
|
||||
attrs,
|
||||
style: Object.assign({
|
||||
height: hasEllipsis && rHeight ? `${rHeight}px` : ''
|
||||
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
||||
}, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null),
|
||||
on: tdOns
|
||||
}, tdVNs)
|
||||
|
||||
@@ -179,8 +179,11 @@ export default {
|
||||
autoResize: { type: Boolean, default: () => GlobalConfig.table.autoResize },
|
||||
// 是否自动根据状态属性去更新响应式表格宽高
|
||||
syncResize: [Boolean, String, Number],
|
||||
// 设置列的默认参数,仅对部分支持的属性有效
|
||||
// 列配置信息
|
||||
columnConfig: Object,
|
||||
// 行配置信息
|
||||
rowConfig: Object,
|
||||
// 列调整配置项
|
||||
resizableConfig: Object,
|
||||
// 序号配置项
|
||||
seqConfig: Object,
|
||||
@@ -453,7 +456,10 @@ export default {
|
||||
}
|
||||
},
|
||||
columnOpts () {
|
||||
return Object.assign({}, this.columnConfig)
|
||||
return Object.assign({}, GlobalConfig.table.columnConfig, this.columnConfig)
|
||||
},
|
||||
rowOpts () {
|
||||
return Object.assign({}, GlobalConfig.table.rowConfig, this.rowConfig)
|
||||
},
|
||||
resizableOpts () {
|
||||
return Object.assign({}, GlobalConfig.table.resizableConfig, this.resizableConfig)
|
||||
@@ -780,6 +786,9 @@ export default {
|
||||
if (this.treeConfig && this.checkboxOpts.range) {
|
||||
UtilTools.error('vxe.error.noTree', ['checkbox-config.range'])
|
||||
}
|
||||
if (this.rowOpts.height && !this.showOverflow) {
|
||||
UtilTools.warn('vxe.error.notProp', ['table.show-overflow'])
|
||||
}
|
||||
if (!this.handleUpdateCellAreas) {
|
||||
if (this.clipConfig) {
|
||||
UtilTools.warn('vxe.error.notProp', ['clip-config'])
|
||||
|
||||
Reference in New Issue
Block a user