Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document is not defined #8

Open
simplenotezy opened this issue Nov 19, 2020 · 1 comment
Open

document is not defined #8

simplenotezy opened this issue Nov 19, 2020 · 1 comment

Comments

@simplenotezy
Copy link

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
@robiveli
Copy link
Owner

robiveli commented Jan 2, 2021

@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'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants