jpopup icon indicating copy to clipboard operation
jpopup copied to clipboard

document is not defined

Open simplenotezy opened this issue 4 years ago • 1 comments

I tried including this in a Nuxt (vue.js) project, that has server side rendering, with this basic example:

<template>
	<div>
		<h1>Hi World</h1>
	</div>
</template>

<script>
import jPopup from 'jPopup';
export default {
	data () {
		return {
			popup: null
		}
	},
	mounted () {
		// eslint-disable-next-line new-cap
		this.popup = new jPopup({ // initialize jPopup
			content: '<p>Lorem Ipsum...</p>',
			transition: 'fade',
			onOpen: ($popupElement) => {
				console.log('popup open');
			},
			onClose: ($popupElement) => {
				console.log('popup closed');
			}
		});

		this.popup.open();
	}
}
</script>

<style lang="scss" scoped>

</style>

However, it will crash the whole app:

document is not defined

simplenotezy avatar Nov 19 '20 14:11 simplenotezy

@simplenotezy Hi, not sure what could be the cause of that, there are just couple of standard JS selectors in the code (e.g. document.querySelector('html'))

robiveli avatar Jan 02 '21 12:01 robiveli