Vue Tip: Check Version at Runtime

Michael Hoffmann
Apr 10, 2022
| 1 min read
| 117 views
Michael Hoffmann
Apr 10, 2022
1 min read
| 117 views
Script

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 Twitter to get notified about new tips, blog posts, and more. Alternatively (or additionally), you can subscribe to my weekly Vue newsletter.
Vue Tip: Measure PerformanceApr 4, 2022
Vue Tip: Query Inner Elements in Third-Party ComponentsApr 21, 2022
Show comments