UNPKG

@nextcloud/vue

Version:
16 lines (15 loc) 450 B
import i from "vue"; const n = new i({ data() { return { isMobile: !1 }; }, watch: { isMobile(e) { this.$emit("changed", e); } }, created() { window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize(); }, beforeDestroy() { window.removeEventListener("resize", this.handleWindowResize); }, methods: { handleWindowResize() { this.isMobile = document.documentElement.clientWidth < 1024; } } }); export { n as I };