vue-sticky-directive icon indicating copy to clipboard operation
vue-sticky-directive copied to clipboard

The directive causes SSR fail

Open dreamerblue opened this issue 4 years ago • 1 comments

Once I render page by vue-server-renderer, the page component using vue-sticky-directive will render fail with error "ReferenceError: window is not defined".

https://github.com/mehwww/vue-sticky-directive/blob/master/src/index.js#L7

dreamerblue avatar Nov 13 '20 09:11 dreamerblue

@dreamerblue workaround, if you're using bundler, I'm using is:

import Sticky from 'vue-sticky-directive/src/sticky';
Vue.directive('Sticky', Sticky);

NetCZ avatar Nov 13 '20 14:11 NetCZ