vue-swipe icon indicating copy to clipboard operation
vue-swipe copied to clipboard

Not support ssr ?

Open mehwww opened this issue 9 years ago • 2 comments

I have a problem using vue-swipe in my universal project, it seems doesn't support ssr cause I met a ReferenceError: document is not defined.

2016-11-07 5 32 37

This problem seems come from your wind-dom deps but I could not find the repo, can you guys fix this bug or add this feature? 😀

mehwww avatar Nov 07 '16 09:11 mehwww

+1

oct16 avatar Nov 24 '16 15:11 oct16

tl;dr

remove wind-dom once deps (if u are editing the node_module for quick use, like what I did, do not forget to change 'main' in package.json)

quick fix

swipe.vue comment line 60: //import { once } from 'wind-dom/src/event'; replace line 156: once(element, 'webkitTransitionEnd', transitionEndCallback); with:

if(document.addEventListener) {
  element.addEventListener('webkitTransitionEnd', transitionEndCallback, false);
}else{
  element.attachEvent('onwebkitTransitionEnd', transitionEndCallback);
}

I may send the pull request once free

w10036w avatar Dec 30 '16 04:12 w10036w