当前位置: 首页 > news >正文

handsontable输入中文第一个字母丢失问题

首先查看 版本是否为最新版本 ,官网说 V14.4已经修复了问题

github上有解决方法https://github.com/handsontable/handsontable/issues/10773#issuecomment-1940713298

加上这个参数

:imeFastEdit="true"

另外说一下怎么重新实现将自带的功能(删除行/删除列等等)放到submenu中

首先自定义的二级菜单(submenu) 需要和外层定义的key 相同 并以 外层key:子级key的命名方式来实现,

在内部必须使用callback 来实现原有的功能 (不用自己完全实现)

关键点 直接使用 hot.alter('功能key名称', rowIndex, amount)

示例

items: { custom: { name: '行列操作', submenu: { items: [ { key: 'custom:remove_row', name: '删除行', callback() { const hot =getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.min(startRow, endRow) const amount = Math.abs(endRow - startRow) + 1 hot.alter('remove_row', rowIndex, amount) } }, { key: 'custom:remove_col', name: '删除列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.min(startCol, endCol) const amount = Math.abs(endCol - startCol) + 1 hot.alter('remove_col', colIndex, amount) } }, { key: 'sep1', name: '---------' }, { key: 'custom:col_left', name: '左侧插入列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.min(startCol, endCol) hot.alter('insert_col_start', colIndex, 1) } }, { key: 'custom:col_right', name: '右侧插入列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.max(startCol, endCol) + 1 hot.alter('insert_col_start', colIndex, 1) } }, { key: 'custom:row_above', name: '上方插入行', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.min(startRow, endRow) hot.alter('insert_row_above', rowIndex, 1) } }, { key: 'custom:row_below', name: '下方插入行', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.max(startRow, endRow) hot.alter('insert_row_below', rowIndex, 1) } } ] } }, } function getHotInstance(): Handsontable | null { return (hotTable.value?.hotInstance as Handsontable) ?? null }
http://www.cnnetsun.cn/news/2071319.html

相关文章:

  • 小白力扣算法题day08-树
  • 如何快速解决Windows HEIC预览问题:终极免费解决方案指南
  • 别再只用add_metrology了!Halcon直线检测的4个冷门算子实战对比(附完整代码)
  • 英雄联盟智能工具包:三大核心功能让你的游戏体验全面提升
  • 电解电容 vs 陶瓷电容:同样是电容,为什么用法差这么多?
  • 深入理解C++模板
  • 告别WSL2的snap安装烦恼:一键配置systemd并管理你的Ubuntu服务
  • 考研复习 Day 19 | 数据结构与算法--图(下)
  • 情感分析技术:原理、实现与应用全解析
  • Model Context Protocol:机器学习模型全生命周期管理的关键
  • 别再乱用if-else了!Verilog条件语句的5个实战避坑指南(附代码对比)
  • 快手万人组织的 AI 研发范式跃迁和落地实践
  • 3分钟搞定!Windows系统显示iPhone HEIC照片缩略图终极指南
  • Betaflight飞控系统架构解析与技术实现方案
  • 如何实现微信聊天记录永久保存:WeChatMsg本地化数据管理革命
  • 2026年必知!那些便携又好带,让人欲罢不能的青岛特产!
  • Windows逆向实战:手把手教你用WinDbg和OD定位TEB结构(含FS寄存器详解)
  • 别再乱开V-Sync了!游戏开发者必懂的垂直同步原理与实战避坑指南(附OpenGL/DirectX代码)
  • Elsevier Tracker:学术投稿效率神器终极指南
  • 别再手动敲测试数据了!Vivado仿真中$readmemb/h的6种用法详解与避坑指南
  • ANSYS APDL新手避坑指南:用悬臂梁案例搞定你的第一个静力学分析
  • 如何用PodcastBulkDownloader一键备份你喜爱的播客内容?
  • 论文“瘦身”新革命:书匠策AI,让学术文字焕发新生!
  • MarkDown时序图进阶:巧用并行、条件与循环构建复杂交互逻辑
  • 手把手教你用DSP28335的定时器中断实现增量式PID控制(附完整代码)
  • 【C++26反射元编程实战图谱】:含完整UML架构设计图+AST遍历时序图+编译期契约检查模板(附GitHub私有仓库邀请码)
  • 别再手动存localStorage了!用Vue的keep-alive搞定Ruoyi后台页面状态保留(附完整配置流程)
  • 从零搭建ROS2机器人仿真环境:Gazebo+Rviz2联合调试完整指南(含传感器配置)
  • 从‘等比例缩小’到‘等效缩减’:一文看懂芯片制程演进背后的材料与结构‘魔法’
  • C23标准内存安全扩展深度解密(std::memsec.h草案+bounded_array_t+safe_ptr_t),2026年前必须掌握的5个迁移路径