js滚动条自动划到最底部
const divs = document.getElementById('templateModel')
divs.scrollTop = divs.scrollHeight
2024-1-24更新
对话问答时,自动滚动到最下面一条对话。
const scrollToBottom = useCallback(() => { const element = document.querySelector('div[class^=Container]:last-child'); if (element) { element.scrollIntoView({ block: 'end', inline: 'nearest', behavior: 'smooth', }); } }, []);
浅喜似苍狗,深爱如长风