forked from FoundKeyGang/FoundKey
Use optional chaining for onMounted sidebar
This commit is contained in:
parent
4fcbf3af36
commit
e6daf45cd7
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ watch(iconOnly, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (sidebar && sidebar.parentElement) {
|
if (sidebar?.parentElement) {
|
||||||
const sticky = new StickySidebar(sidebar.parentElement, 16);
|
const sticky = new StickySidebar(sidebar.parentElement, 16);
|
||||||
window.addEventListener('scroll', () => {
|
window.addEventListener('scroll', () => {
|
||||||
sticky.calc(window.scrollY);
|
sticky.calc(window.scrollY);
|
||||||
|
|
Loading…
Reference in a new issue