(header) back button if app installed

This commit is contained in:
Julien Calixte
2019-11-28 23:05:40 +01:00
parent 87fab8f7c3
commit b5d3baaf24
7 changed files with 43 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
<template>
<span>
<slot v-if="isInstalled" name="app-installed"></slot>
<slot v-else name="app-not-installed"></slot>
</span>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component
export default class AppInstalled extends Vue {
private isInstalled: boolean = false
private mounted() {
this.isInstalled =
window.matchMedia &&
window.matchMedia('(display-mode: standalone)').matches
}
}
</script>