0 votes
in VueJS by
How do you find VueJS version using API?

1 Answer

0 votes
by

The community plugins and components might need different strategies for different versions. In this case, you can use Vue.version which provides installed version of Vue as a string.

For example, you can implement different logic based on different versions

let version = Number(Vue.version.split('.')[0])

if (version === 2) {
  // Vue v2.x.x
} else if (version === 1) {
  // Vue v1.x.x
} else {
  // Unsupported versions of Vue
}

Related questions

0 votes
asked Sep 7, 2023 in VueJS by DavidAnderson
0 votes
asked Sep 12, 2023 in VueJS by GeorgeBell
...