feat: PWA
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
|
||||
|
||||
export function useScreenSize() {
|
||||
const size = reactive({
|
||||
@@ -6,6 +6,8 @@ export function useScreenSize() {
|
||||
height: window.innerHeight,
|
||||
})
|
||||
|
||||
const isMobile = computed(() => size.width < 640)
|
||||
|
||||
const onResize = () => {
|
||||
size.width = window.innerWidth
|
||||
size.height = window.innerHeight
|
||||
@@ -19,9 +21,11 @@ export function useScreenSize() {
|
||||
window.removeEventListener('resize', onResize)
|
||||
})
|
||||
|
||||
return size
|
||||
return {
|
||||
size,
|
||||
isMobile,
|
||||
}
|
||||
}
|
||||
// write a composable for detecting swipe gestures in mobile devices
|
||||
export function useSwipe() {
|
||||
const swipe = reactive({
|
||||
initialX: null,
|
||||
|
||||
Reference in New Issue
Block a user