Skip to content
Snippets Groups Projects
Commit 49b43eb3 authored by syuilo's avatar syuilo
Browse files

🎨

parent 6b22b7a3
No related branches found
No related tags found
No related merge requests found
......@@ -91,11 +91,15 @@ export default defineComponent({
bg.setAlpha(0.85);
this.bg = bg.toRgbString();
if (this.$el.parentElement == null) return;
this.narrow = this.$el.parentElement.offsetWidth < 500;
new ResizeObserver((entries, observer) => {
if (this.$el.parentElement) {
this.narrow = this.$el.parentElement.offsetWidth < 500;
}).observe(this.$el.parentElement);
new ResizeObserver((entries, observer) => {
this.narrow = this.$el.parentElement.offsetWidth < 500;
}).observe(this.$el.parentElement);
const currentStickyTop = getComputedStyle(this.$el).getPropertyValue('--stickyTop') || '0px';
this.$el.style.setProperty('--stickyTop', currentStickyTop);
this.$el.parentElement.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${this.$el.offsetHeight}px)`);
}
},
methods: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment