修改滚动平滑

This commit is contained in:
zilong 2021-10-29 01:46:52 +08:00
parent 25af6cfedb
commit 15d20b8b52

View File

@ -66,12 +66,16 @@ const handleLyric = (ly) => {
};
watch(
()=> currentLyricIdx.value,
(val)=>{
()=> [currentLyricIdx.value,store.state.showSongDetail],
([val, showSongDetail])=>{
console.log('changed lyric');
if(val>0){
// let elContent = document.getElementsByClassName('ly-content')[0]
nextTick(()=>{
let el = document.getElementsByClassName('ly-key-lines')[val]
lyList.value.scrollTop = el.offsetTop - 100
})
}
},
{
@ -299,6 +303,7 @@ export default {};
margin-top: 15px;
height: 290px;
overflow-y: auto;
scroll-behavior: smooth;
// background-image : linear-gradient(180deg,hsla(255,0%,100%,0),rgba(255, 255, 255, 0.521));