Thanks to visit codestin.com
Credit goes to github.com

Skip to content

document is not defined #8

@simplenotezy

Description

@simplenotezy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions