·
0 min read
Vue Tip: Check Version at Runtime
It's possible to check Vue's version at runtime by importing version
from the Vue npm package and splitting the string at the .
character:
<template>
<h1>Vue Version: {{ vueVersion }}</h1>
</template>
<script setup>
import { version } from 'vue'
const vueVersion = version.split('.')[0]
</script>
If you liked this Vue tip, follow me on X to get notified about new tips, blog posts, and more. Alternatively (or additionally), you can subscribe to my weekly Vue & Nuxt newsletter:
Vue Tip: Measure Performance
Learn some tools to measure the performance of your Vue application.
Vue Tip: Query Inner Elements in Third-Party Components
In some cases, we have to deal with third-party Vue components where we cannot put a ref on inner HTML elements to access them in our Vue code.