Skip to content

Commit

Permalink
docs: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Jul 11, 2024
1 parent 5b34d46 commit ebaa6fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions s2-site/docs/manual/advanced/get-cell-data.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ s2.on(S2Event.DATA_CELL_CLICK, (event) => {
// 获取当前列数据
const colData = s2.dataSet.getCellMultiData({ query: meta.colQuery })

console.log('当前行数据:', rowData)
console.log('当前列数据:', colData)
console.log('当前行数据:', rowData)
console.log('当前单元格数据:', meta.data)
/**
{
Expand Down Expand Up @@ -335,8 +335,8 @@ s2.on(S2Event.DATA_CELL_CLICK, (event) => {
query: meta.colQuery
})

console.log('当前行数据:', rowData) // { province: '吉林', city: '长春', type: '笔', price: 8 }
console.log('当前列数据:', colData)
console.log('当前行数据:', rowData) // { province: '吉林', city: '长春', type: '笔', price: 8 }
console.log('当前单元格数据:', meta.data) // { city: '长春' }
})
```
Expand All @@ -349,9 +349,9 @@ s2.on(S2Event.DATA_CELL_CLICK, (event) => {

```ts
// 找到 "舟山市" 对应的行头单元格节点
const rowCellNode = s2.facet.getRowNodes().find((node) => node.id === 'root[&] 浙江省 [&] 舟山市')
const rowCellNode = s2.facet.getRowNodes().find((node) => node.id === 'root[&]浙江省[&]舟山市')
// 找到 "办公用品" 下 "纸张" 对应的 "数量"列头单元格节点
const colCellNode = s2.facet.getColNodes().find((node) => node.id === 'root[&] 办公用品 [&] 纸张 [&] 数量')
const colCellNode = s2.facet.getColNodes().find((node) => node.id === 'root[&]办公用品[&]纸张[&]数量')

const data = s2.dataSet.getCellMultiData({
query: {
Expand Down
4 changes: 2 additions & 2 deletions s2-site/docs/manual/basic/tooltip.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ to customize. [Example](/examples/react-component/tooltip#custom-hover-show-tool
```tsx
const CustomColCellTooltip = () => <div>col cell tooltip</div>;

const onRowCellHover = ({ event, meta }) => {
meta.spreadsheet.tooltip.show({
const onRowCellHover = ({ event, viewMeta }) => {
viewMeta.spreadsheet.tooltip.show({
position: {
x: event.clientX,
y: event.clientY,
Expand Down

0 comments on commit ebaa6fb

Please sign in to comment.