S2
S2 copied to clipboard
@antv/s2-vue SheetComponent 的 loading 属性失效
版本依赖
- @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,请按照 issue 模板填写相关信息, 方便大家高效沟通, 强烈推荐你阅读 提 Issue 前必读 和 如何向开源项目提交无法解答的问题。
Hello @minikinl, please fill in the relevant information according to the issue template to facilitate communication efficiently. recommend you to read 提 Issue 前必读 and 如何向开源项目提交无法解答的问题, Thanks so much!
直接来个 PR?
sry 我是直接从源码页发起的 issue,没有注意到 issue 模板~
有空的时候会再继续跟进hh