mehwww / vue-sticky-directive

A powerful vue directive make element sticky.
MIT License
172 stars 47 forks source link

Doesnt working with nuxt #27

Open VladStepanov opened 5 years ago

VladStepanov commented 5 years ago

Im using nuxt

nuxt.config.js
{ src: '~/plugins/sticky.js', ssr: false }

sticky.js
import Vue from 'vue
import Sticky from 'vue-sticky-directive

Vue.use(Sticky)

and i'm getting that. image

What im doing wrong?

scoutrul commented 5 years ago

It is working with nuxt but i'm not satisfied becouse of bugs.

VladStepanov commented 5 years ago

@VladStepanov were you able to solve this?

No :(

mavrick commented 4 years ago

if you can get away with just using css, you could try:

position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
Smidds commented 4 years ago

I think one of the things myself and others enjoy about this directive is the ability to listen to sticky events and respond. I currently had to remove this from my nuxt project as it was working, but only when reloading the page that it was used on to get a fresh version from nuxt of that specific page (still not sure why).

simplenotezy commented 4 years ago

It's working fine for me on nuxt, but it has some issues, especially with the "onStick" callback

tbredin commented 4 years ago

+1

tbredin commented 4 years ago

For me this initialises fine in nuxt, but it never actually triggers any sticky behaviour. onStick is simply called when the page first loads:

image

ghost commented 4 years ago

same here 👎

isuke01 commented 3 years ago

Actually it works for me ONLY if I set sticky-side="0" also interesting thing is if you want to work sticky-offset you must enter STRING, you cant put object... interesting ... NOT WORKING: :sticky-offset="{top: 500, bottom: 20}" or :sticky-offset="ObjectVarrible" Working: sticky-offset="{top: 500, bottom: 20}" or :sticky-offset="StringVarrible"

JackEdwardLyons commented 3 years ago

@isuke01 writing it as a string worked, thanks for the tip!