Skip to content

Not work in Ionic/Vue #2

Description

@damianlluch

Hello! Thank you for sharing these resources.

I tried in my Ionic / Vue project with its code in the mounted function () and it doesn't work. The button has the display property in none always

`mounted() {
const $button = document.querySelector('#installButton')

		pwaInstallHandler.addListener((canInstall) => {
			$button.style.display = canInstall ? 'inline-block' : 'none'
		})

		$button.addEventListener('click', () => {
			pwaInstallHandler.install().then((isInstalled) => {
				console.log(
						isInstalled
								? 'User accepted installation prompt'
								: 'User rejected installation prompt'
				)
			})
		})`

any suggestions?

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