I’m really liking Vue.js, especially for existing projects

by Thomas Beutel

Vue.js promotes itself as a progressive framework, meaning that you can start small and use as little or as much as you need. I’ve been working on Vue.js projects at both ends, some full fledged projects using vuex, components, and vue-cli, and some projects which are just a single component in an existing web page. It is the latter that I’m really jazzed about.

The fact that I can use vue.js standalone on an existing page is amazing. It allows me to introduce reactivity and easily pull in APIs while leaving the rest of the page alone. For small projects like this, all of the component code can be kept in one javascript file, making maintenance easier. Vue.js is especially useful for websites that use a CMS and are a bit clumsy to work with. Most CMSes also have a JSON API either natively or with a plugin that you can leverage by adding axios.js.

I recently needed to add a small bit of third party data to an Expression Engine page. Vue.js made it easy to add. All I needed to do was to load a minified version of vue.js and axios, plus the code for the component. Three files, with the component code all in one place for easy maintenance.

Vue.js is a great platform for larger multicomponent projects managed via webpack, but it is also so nice to use for small single page enhancements.