✨ (header) back button if app installed
This commit is contained in:
21
src/components/AppInstalled.vue
Normal file
21
src/components/AppInstalled.vue
Normal 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>
|
||||
Reference in New Issue
Block a user