S2 icon indicating copy to clipboard operation
S2 copied to clipboard

@antv/s2-vue SheetComponent 的 loading 属性失效

Open minikinl opened this issue 4 months ago • 3 comments

版本依赖

  • @antv/s2: 2.0.0-next.28
  • @antv/s2-vue: 2.0.0-next.15
  • vue: 3.2.41
  • ant-design-vue: 3.2.13

问题描述

更新 loading 状态未显示加载状态

问题排查

https://github.com/antvis/S2/blob/53c04dc1ce82d5d24e73ac41db3b659189142c57/packages/s2-vue/src/hooks/useSpreadSheet.ts#L30

vue setup 中的 hook 区别于 react,仅在组件创建时执行一次,直接解构 props 会导致失去响应性。

建议使用以下方式解构,或直接 watch props.loading 并更新 loading 状态。

const { ... } = toRefs(props); 

目前只发现 loading 不生效,其余功能待进一步测试,但看源码应该是存在问题的。

minikinl avatar Oct 12 '24 07:10 minikinl