vxe-table icon indicating copy to clipboard operation
vxe-table copied to clipboard

表格支持通过列配置设置该列排序Icon悬浮后的title提示

Open KeyToLove opened this issue 2 months ago • 2 comments

这个需求解决了什么问题:

有些场景下,一份表格的多个字段排序底层逻辑不是一致的,期望通过悬浮Icon展示不同的title来进行底层排序逻辑的补充说明,在兼容现有交互的场景下,期望通过拓展 columns 配置实现这个功能

建议的 API 是什么样的:

const columns = [
{
   title: '姓名',
   field: 'name',
   sortConfig: {
     ascTitle: '从A到Z排序',
      descTitle: '从Z到A排序',
 },
{
   title: '时间',
   field: 'time',
   sortConfig: {
     ascTitle: '从早到晚',
      descTitle: '从晚到早',
 },
}

是否已有其他不错的替代方案:

No response

是否使用当前最新版本?

  • [x] 我已确认是使用当前的最新版本。

KeyToLove avatar Oct 31 '25 07:10 KeyToLove

如果要完全自定义可以去使用插槽模板

xuliangzhan avatar Nov 03 '25 02:11 xuliangzhan

如果要完全自定义可以去使用插槽模板

看了下这块API,确实足够灵活可以实现,不过要编写额外的template代码,并且绑定对应的排序事件;能同时支持columns配置来处理这种场景可能会更简洁一些。 例如: columns.sortConfig 支持一些 UI 相关的个性化定制,ascTitle descTitle iconAsc iconDesc 等,结合 vxe-table / vxe-grid 根 props 的 sort-config 做逻辑/行为的统一处理,可以省去多余的 template 代码。

KeyToLove avatar Nov 03 '25 03:11 KeyToLove