Skip to content

Instantly share code, notes, and snippets.

@MinSomai
Created March 24, 2022 07:20
Show Gist options
  • Save MinSomai/6eee7cb0cfc7222f14becb804e3abbf3 to your computer and use it in GitHub Desktop.
Save MinSomai/6eee7cb0cfc7222f14becb804e3abbf3 to your computer and use it in GitHub Desktop.
Vue show viewport height and width in title for debugging with vueuse
<script>
import { ref, computed, onMounted } from "@vue/composition-api";
import { useWindowSize, useTitle } from "@vueuse/core";
export default {
setup() {
const { width, height } = useWindowSize();
const title = computed(() => {
return `w: ${width.value} h: ${height.value}`;
});
useTitle(title);
return {};
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment