You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recommended:[unpkg](https://unpkg.com/vue/dist/vue.js), 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/](https://unpkg.com/vue/).
Also available on [jsdelivr](//cdn.jsdelivr.net/vue/{{vue_version}}/vue.js)or[cdnjs](//cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js), but these two services take some time to sync so the latest release may not be available yet.
@@ -43,15 +43,16 @@ Also available on [jsdelivr](//cdn.jsdelivr.net/vue/{{vue_version}}/vue.js) or [
43
43
$ npm install vue
44
44
```
45
45
46
-
### Standalone vs. Runtime-only Build
46
+
### 独立构建 vs 运行时构建
47
47
48
-
There are two builds available, the standalone build and the runtime-only build.
48
+
有两种构建方式,独立构建和运行构建。
49
49
50
-
- 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 the `render`option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render`functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
<pclass="tip">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.</p>
67
+
<pclass="tip">不要用 `import Vue from 'vue/dist/vue.js'` - 由于一些工具或第三方库引入 Vue , 这可能会导致应用程序运行时加载和独立构建导致错误</p>
67
68
68
-
### CSP environments
69
+
### CSP 环境
69
70
70
-
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.
71
+
有些环境,如 Google Chrome Apps,强制应用内容安全策略 (CSP) ,不能使用 new Function() 对表达式求值。这时可以用 CSP 兼容版本。独立的构建取决于该功能编译模板,所以无法使用这些环境。
71
72
72
-
On the other hand, the runtime-only build is fully CSP-compliant. When using the runtime-only build with [Webpack + vue-loader](https://github.com/vuejs-templates/webpack-simple) or [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple), your templates will be precompiled into `render` functions which work perfectly in CSP environments.
**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!
0 commit comments