Open leyafo opened 2 weeks ago
在项目根目录下运行:
pnpm install pnpm build
scrollRef,
src/views/chat/hooks/useScroll.ts:7:3 7 scrollRef: Ref<ScrollElement>
The expected type comes from property 'scrollRef' which is declared here on type 'ScrollReturn'
仔细看了下代码,是vue的ref 和 Ref 转换的问题。
interface ScrollReturn { scrollRef: Ref<ScrollElement> scrollToBottom: () => Promise<void> scrollToTop: () => Promise<void> scrollToBottomIfAtBottom: () => Promise<void> } export function useScroll(): ScrollReturn { const scrollRef = ref<ScrollElement>(null)
定义的是大写的 Ref, 返回的是小写的 ref。
试试 pnpm build-only
在项目根目录下运行:
scrollRef,
仔细看了下代码,是vue的ref 和 Ref 转换的问题。
定义的是大写的 Ref, 返回的是小写的 ref。