This commit is contained in:
syuilo
2021-04-14 03:34:56 +09:00
parent 930127348a
commit e404e5e2de
3 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ export default {
//const query = binding.value;
const header = src.children[0];
const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop');
const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px';
src.style.setProperty('--stickyTop', `${parseInt(currentStickyTop) + header.offsetHeight}px`);
header.style.setProperty('--stickyTop', currentStickyTop);
header.style.position = 'sticky';