Skip to content

Commit

Permalink
releases 4.10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Jan 24, 2025
1 parent 259fee5 commit 18dcbe8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.10.6-beta.30",
"version": "4.10.6-beta.31",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down Expand Up @@ -28,7 +28,7 @@
"style": "lib/style.css",
"typings": "types/index.d.ts",
"dependencies": {
"vxe-pc-ui": "^4.3.77"
"vxe-pc-ui": "^4.3.78"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",
Expand Down
22 changes: 13 additions & 9 deletions packages/table/src/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ export const Cell = {
const { $table, column } = params
const { computeSortOpts } = $table.getComputeMaps()
const sortOpts = computeSortOpts.value
const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
const { order } = column
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
return [
Expand All @@ -897,20 +897,24 @@ export const Cell = {
'sort--active': order === 'asc'
}],
title: getI18n('vxe.table.sortAsc'),
onClick (evnt: Event) {
evnt.stopPropagation()
$table.triggerSortEvent(evnt, column, 'asc')
}
onClick: allowBtn
? (evnt: Event) => {
evnt.stopPropagation()
$table.triggerSortEvent(evnt, column, 'asc')
}
: undefined
}),
h('i', {
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
'sort--active': order === 'desc'
}],
title: getI18n('vxe.table.sortDesc'),
onClick (evnt: Event) {
evnt.stopPropagation()
$table.triggerSortEvent(evnt, column, 'desc')
}
onClick: allowBtn
? (evnt: Event) => {
evnt.stopPropagation()
$table.triggerSortEvent(evnt, column, 'desc')
}
: undefined
})
])
]
Expand Down
11 changes: 8 additions & 3 deletions packages/table/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,18 @@ export default {
type: Boolean as PropType<VxeTablePropTypes.HighlightHoverRow>,
default: () => getConfig().table.highlightHoverRow
},
// (即将废弃)是否要高亮当前选中列

/**
* (即将废弃)是否要高亮当前选中列
* @deprecated
*/
highlightCurrentColumn: {
type: Boolean as PropType<VxeTablePropTypes.HighlightCurrentColumn>,
default: () => getConfig().table.highlightCurrentColumn
},
// (即将废弃)鼠标移到列是否要高亮显示
/**
* (即将废弃)鼠标移到列是否要高亮显示
* @deprecated
*/
highlightHoverColumn: {
type: Boolean as PropType<VxeTablePropTypes.HighlightHoverColumn>,
default: () => getConfig().table.highlightHoverColumn
Expand Down
5 changes: 4 additions & 1 deletion packages/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7812,10 +7812,13 @@ export default defineComponent({
*/
triggerSortEvent (evnt, column, order) {
const sortOpts = computeSortOpts.value
const { multiple, allowClear } = sortOpts
const { field, sortable } = column
if (sortable) {
if (!order || column.order === order) {
tableMethods.clearSort(sortOpts.multiple ? column : null)
if (allowClear) {
tableMethods.clearSort(multiple ? column : null)
}
} else {
tableMethods.sort({ field, order })
}
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ VxeUI.setConfig({
// orders: ['asc', 'desc', null],
// sortMethod: null,
showIcon: true,
allowClear: true,
allowBtn: true,
iconLayout: 'vertical'
},
filterConfig: {
Expand Down

0 comments on commit 18dcbe8

Please sign in to comment.