[Feature] vtable-vue的dataConfig配置项totals动态变更,如何更新,目前不会主动渲染
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
What problem does this feature solve?
vtable-vue的dataConfig配置项totals动态变更,如何更新,目前不会主动渲染
<PivotTable :options="tableOptions" :records="records" ref="pivotTableRef">
其中tableOptions的dataConfig如下:
dataConfig: {
totals: {
row: {
showGrandTotals: true,
showSubTotals: false,
subTotalsDimensions: [],
grandTotalLabel: 'Row Totals',
subTotalLabel: 'Sub Totals'
},
column: {
showGrandTotals: true, // 总合计列
showSubTotals: true, // 组内合计列
subTotalsDimensions: ['Region'],
grandTotalLabel: 'Column Totals',
subTotalLabel: 'Sub Totals'
}
}
},
点击事件动态修改showGrandTotals的值,发现vtable不会主动更新,尝试使用vtable实例提供的updateOption并未生效
const handleClick = () => {
const show = tableOptions.value.dataConfig.totals.row.showGrandTotals
tableOptions.value.dataConfig.totals.row.showGrandTotals = !show
}
What does the proposed API look like?
期望可以提供一个update方法可以主动更新图表,update(option) option为当前的option
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the vtable-vue PivotTable usage and the tableOptions.dataConfig.totals fields described in the issue, then trace how the exposed updateOption path handles option changes. Verify that toggling showGrandTotals causes the table to rerender and that a proposed update(option) API accepts the current options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100