fortune-sheet icon indicating copy to clipboard operation
fortune-sheet copied to clipboard

[Feature Request] 鼠标钩子支持

Open Deuscx opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. 能否支持提供鼠标钩子 或者 cellEditBefore ,提供当前正在编辑的单元格信息。用于多人编辑时单元格高亮 就像luckysheet一样: image

Link: https://dream-num.github.io/LuckysheetDocs/zh/guide/config.html#%E9%BC%A0%E6%A0%87%E9%92%A9%E5%AD%90

Deuscx avatar Mar 27 '23 07:03 Deuscx

在ctx中包含了hooks,并且其中已包含beforeCellMouseDown image

gazedreamily avatar Mar 28 '23 02:03 gazedreamily

在ctx中包含了hooks,并且其中已包含beforeCellMouseDown image

这里有找到,但是会提示方法报错,和这个issue类型一样 https://github.com/ruilisi/fortune-sheet/issues/238 image

import { Workbook } from '@fortune-sheet/react'

function App() {
  const data = [{ name: 'Sheet1' }]
  const hooks = {
    afterCellMouseDown(cell, cellInfo) {
      console.log('cell, cellInfo:', cell, cellInfo)
    },
  }
  return (
    <Workbook data={data} hooks={ hooks}/>
  )
}

export default App

Deuscx avatar Mar 28 '23 02:03 Deuscx

好的,后续会对hooks部分进行优化

gazedreamily avatar Mar 28 '23 02:03 gazedreamily

项目的协同demo里单元格编辑高亮用的是afterSelectionChange,也可以试试, image

shuanhukexuejia avatar Mar 28 '23 04:03 shuanhukexuejia