- Guide
- API
- Examples
-
Ecosystem
Help
News
Core Plugins
Resource Lists
- Translations
Guide
Essentials
- Installation
- Introduction
- The Vue Instance
- Template Syntax
- Computed Properties and Watchers
- Class and Style Bindings
- Conditional Rendering
- List Rendering
- Event Handling
- Form Input Bindings
- Components
Advanced
- Reactivity in Depth
- Transition Effects
- Transitioning State
- Render Functions
- Custom Directives
- Mixins
- Plugins
- Single File Components
- Production Deployment Tips
- Routing
- State Management
- Unit Testing
- Server-Side Rendering
- TypeScript Support
Migrating
- Migration from Vue 1.x
- Migration from Vue Router 0.7.x
- Migration from Vuex 0.6.x to 1.0
Meta
- Comparison with Other Frameworks
- Join the Vue.js Community!
Installation
Compatibility Note
Vue does not support IE8 and below, because it uses ECMAScript 5 features that are un-shimmable in IE8. However it supports all ECMAScript 5 compliant browsers.
Release Notes
Detailed release notes for each version are available on GitHub.
Standalone
Simply download and include with a script tag. Vue
will be registered as a global variable.
Don’t use the minified version during development. You will miss out all the nice warnings for common mistakes!
Development VersionWith full warnings and debug mode
Production VersionWarnings stripped, 25.86kb min+gzip
CDN
Recommended: unpkg, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at unpkg.com/vue/.
Also available on jsDelivr or cdnjs, but these two services take some time to sync so the latest release may not be available yet.
NPM
NPM is the recommended installation method when building large scale applications with Vue. It pairs nicely with module bundlers such as Webpack or Browserify. Vue also provides accompanying tools for authoring Single File Components.
|
Standalone vs. Runtime-only Build
There are two builds available, the standalone build and the runtime-only build. The difference being that the former includes the template compiler and the latter does not.
The template compiler is responsible for compiling Vue template strings into pure JavaScript render functions. If you want to use the template
option, then you need the compiler.
The standalone build includes the compiler and supports the
template
option. It also relies on the presence of browser APIs so you cannot use it for server-side rendering.The runtime-only build does not include the template compiler, and does not support the
template
option. You can only use therender
option when using the runtime-only build, but it works with single-file components, because single-file components’ templates are pre-compiled intorender
functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 18.01kb min+gzip.
By default, the NPM package exports the runtime-only build. To use the standalone build, add the following alias to your Webpack config:
|
For Browserify, you can add an alias to your package.json:
|
Do NOT do import Vue from 'vue/dist/vue.js'
- since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.
CSP environments
Some environments, such as Google Chrome Apps, enforce Content Security Policy (CSP), which prohibits the use of new Function()
for evaluating expressions. The standalone build depends on this feature to compile templates, so is unusable in these environments.
On the other hand, the runtime-only build is fully CSP-compliant. When using the runtime-only build with Webpack + vue-loader or Browserify + vueify, your templates will be precompiled into render
functions which work perfectly in CSP environments.
CLI
Vue.js provides an official CLI for quickly scaffolding ambitious Single Page Applications. It provides batteries-included build setups for a modern frontend workflow. It takes only a few minutes to get up and running with hot-reload, lint-on-save, and production-ready builds:
|
The CLI assumes prior knowledge of Node.js and the associated build tools. If you are new to Vue or front-end build tools, we strongly suggest going through the guide without any build tools before using the CLI.
Dev Build
Important: the built files in GitHub’s /dist
folder are only checked-in during releases. To use Vue from the latest source code on GitHub, you will have to build it yourself!
|
Bower
|
AMD Module Loaders
The standalone downloads or versions installed via Bower are wrapped with UMD so they can be used directly as an AMD module.