O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Mastering Single File Components

As we promised, in this chapter we are going to review single file components. To build these single file Vue components we need tools like Webpack with vue-loader, or Browserify with vueify. For our examples, we are going to use Webpack, which we've already seen how it works. If you prefer Browserify or something else, feel free to use it.

Single file components or Vue components allow us to specify a template, a script, and style rules, all in one file using *.vue extension. So, each component encapsulates its CSS styles, template, and JavaScript code, in the same place. And that's were Webpack steps in, to bundle this new type of files with the others.

In addition, we need vue-loader (https://github.com/vuejs/vue-loader ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required