Headless CMS & Vue.JS Apps: Delivering Innovative Digital ExperiencesDec 09, 2019
In recent years, the adoption of single-page apps (SPAs) has grown dramatically as companies seek ways to provide more dynamic digital experiences. The Vue framework, in particular, has been gaining popularity — and has even surpassed Angular in terms of positive usage — with 29% of web developers saying they’ve used Vue and would like to use it again .
The move towards SPA frontend frameworks like Vue, however, is largely driven by frontend developers, and often leaves marketers in the dark when it comes to managing the content-driven app. That’s because the typical headless content delivery approach doesn’t have the authoring tools marketers require. Organizations, therefore need the right technologies in place to empower marketing teams if they’re going to provide compelling customer experiences with SPAs.
With this in mind, we’ll look at why Vue.JS is becoming more popular, and how you can deliver content-driven experiences with Vue Apps to meet future digital ambitions.
Why Vue.JS Is Growing In Popularity
While React and Angular are more widely used, Vue had been gaining traction with frontend developers. The framework has a much easier learning curve than other SPA frameworks, so organizations can quickly build and launch new applications. That means there are lower barriers to experimentation and innovation.
Vue is highly modular, with loosely coupled components which reduces development time. Modularized apps are also easier to develop and maintain at an enterprise scale. This component-based architecture also has advantages from a content management standpoint, which we’ll cover later on.
On the marketer side of things, Vue and other SPA apps generally offer a better customer experience than traditional websites. Vue apps are optimized for mobile devices and tablets, and they can be turned into PWAs with little additional effort. That means marketers can utilize push notifications, geolocation, and many other native-like capabilities to further interactive with consumers.
dotCMS: Headless Meets Vue
Using headless capabilities, companies can quickly launch a Vue-based app that’s tightly integrated with dotCMS. It’s straightforward for developers and marketers to collaborate when launching new digital experiences because dotCMS has a multitude of frontend integration points, a powerful SPA editing experience, and SEO optimization capabilities.
The dotCMS Everything as a Service approach means developers have the flexibility they need when integrating the platform with a Vue app to pull nearly any information they want from the CMS using APIs. The component-based architecture of Vue can closely match dotCMS objects or content types to seamlessly align the frontend UI to content within the CMS on the backend.
Using the Page API and dotCMS’s Layout as a Service, frontend developers can pull the pages, layouts, and content that marketers create within the CMS and display the information using Vue. The dotCMS layout — rows, columns, and other information about rendering a page — can be parsed into a Vue template, and the containers can become child components within the Vue app as well. When a visitor navigates to a particular Vue route, the app can pull the content and display it within the appropriate components and templates.
Edit Mode Anywhere
Edit Mode Anywhere is dotCMS’s hybrid solution to managing SPAs like Vue. With Edit Mode Anywhere, the Vue app can be deployed external to dotCMS on any Node.js server as long as you specify the endpoint of the app within the Edit Mode Anywhere plugin . This plugin will POST all the relevant page information to the external SPA app, which can then be parsed and rendered within the Vue code.
Once you have dotCMS pointed at the Vue app, you need to include specific HTML attributes within the container code so that marketers will be able to work with the app from the Edit Mode Anywhere interface. These data attributes begin with the “data-dot-” prefix and include the appropriate metadata that Edit Mode Anywhere detects to provide in-context editing, drag-and-drop, live previews, and many other advanced authoring capabilities.
Further Reading: Personalizing Single Page Apps with dotCMS's Headless Capabilities
One of the greatest concerns with using SPAs from a marketing perspective is ensuring the site is optimized for SEO. Vue apps don’t have pages in the traditional sense, so it’s more challenging for search crawlers to properly index them. You should do everything you can to assist search engines by using slug URLs instead of URLs with hashtags, embedding metadata directly into the Vue code, and providing a sitemap.
With dotCMS, you can easily manage additional metadata and make it available via APIs. You can also create a URL map to expose content using slug URLs that are SEO-friendly. Another unique approach is to build a hybrid app using dotCMS that functions like a SPA but has site navigation similar to traditional page-based websites. It’s even possible to have multiple integrated SPAs using dotCMS, so marketing teams can find the right balance between better digital experiences and SEO optimization for their particular organization.
dotCMS: Ready For SPAs
The API-first approach of dotCMS makes headless content delivery straightforward. We’ve covered how dotCMS can tightly integrate with Vue apps — and React apps in the past — but this barely scratches the surface of what’s possible with headless content management and the additional hybrid capabilities of Edit Mode Anywhere. Not only can marketers easily manage a variety of frontends, but they have the tooling they need to SEO optimize them. The flexibility of dotCMS enables content-driven SPAs, PWAs, Alexa, and nearly any other use case in the future.
From a developer perspective, the dotCMS Everything as a Service — and Layout as a Service in particular — streamlines the integration with SPAs. That means a faster time to market and reduced development costs for delivering modern customer experiences. dotCMS enables organizations to achieve their digital ambitions at a lower total cost of ownership.
If you want to learn more about SPA integrations, see our Webinar on building and managing SPAs with dotCMS .