PhpStorm 2017.3 Help

Vue.js

PhpStorm provides intelligent support for the Vue.js framework including:

  • Recognition of the .vue file type.
  • Support for script, style, and template blocks in .vue files. PhpStorm by default provides code completion for ECMAScript 6 inside script blocks and for CSS inside style block. PhpStorm also recognizes the lang attribute inside the script and style tags and allows you to use TypeScript, Pug, and CSS preprocessors instead.
  • Completion for Vue directives in templates.
  • Code completion (Ctrl+Space and navigation (Ctrl+B) for Vue components inside the template tag:
    ws_vue_completion.png

Before you start

Before you start, install and enable the Vue.js plugin. The plugin is not bundled with PhpStorm, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.

That is all, no additional configuration is required to have all Vue.js-related features work in any project.

Working with Vue.js

To start working with Vue.js, do one of the following:

  • Just open an existing project. All Vue.js-related features will work without any additional configuration. To get better code completion for Vue API, install the vue package in your project via npm if it is not installed yet: open the built-in PhpStorm Terminal (Alt+F12) and type npm install vue at the command prompt.
  • Alternatively, follow the Vue.js installation instructions.
Last modified: 3 November 2017

See Also