forked from vuejs/v2.cn.vuejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
271 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
title: 安装 | ||
type: guide | ||
order: 1 | ||
vue_version: 2.7.14 | ||
gz_size: "37.51" | ||
vue_version: 2.7.16 | ||
gz_size: "37.72" | ||
--- | ||
|
||
### 兼容性 | ||
|
@@ -43,20 +43,20 @@ Vue 在其所有项目中公布的功能和行为都遵循[语义化版本控制 | |
对于制作原型或学习,你可以这样使用最新版本: | ||
|
||
``` html | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/vue.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].16/dist/vue.js"></script> | ||
``` | ||
|
||
对于生产环境,我们推荐链接到一个明确的版本号和构建文件,以避免新版本造成的不可预期的破坏: | ||
|
||
``` html | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].14"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].16"></script> | ||
``` | ||
|
||
如果你使用原生 ES Modules,这里也有一个兼容 ES Module 的构建文件: | ||
|
||
``` html | ||
<script type="module"> | ||
import Vue from 'https://cdn.jsdelivr.net/npm/[email protected].14/dist/vue.esm.browser.js' | ||
import Vue from 'https://cdn.jsdelivr.net/npm/[email protected].16/dist/vue.esm.browser.js' | ||
</script> | ||
``` | ||
|
||
|
@@ -85,7 +85,7 @@ Vue 提供了一个[官方的 CLI](https://github.com/vuejs/vue-cli),为单页 | |
|
||
## 对不同构建版本的解释 | ||
|
||
在 [NPM 包的 `dist/` 目录](https://cdn.jsdelivr.net/npm/[email protected].14/dist/)你将会找到很多不同的 Vue.js 构建版本。这里列出了它们之间的差别: | ||
在 [NPM 包的 `dist/` 目录](https://cdn.jsdelivr.net/npm/[email protected].16/dist/)你将会找到很多不同的 Vue.js 构建版本。这里列出了它们之间的差别: | ||
|
||
| | UMD | CommonJS | ES Module (基于构建工具使用) | ES Module (直接用于浏览器) | | ||
| --- | --- | --- | --- | --- | | ||
|
@@ -102,7 +102,7 @@ Vue 提供了一个[官方的 CLI](https://github.com/vuejs/vue-cli),为单页 | |
|
||
- **运行时**:用来创建 Vue 实例、渲染并处理虚拟 DOM 等的代码。基本上就是除去编译器的其它一切。 | ||
|
||
- **[UMD](https://github.com/umdjs/umd)**:UMD 版本可以通过 `<script>` 标签直接用在浏览器中。jsDelivr CDN 的 [https://cdn.jsdelivr.net/npm/[email protected].14](https://cdn.jsdelivr.net/npm/[email protected].14) 默认文件就是运行时 + 编译器的 UMD 版本 (`vue.js`)。 | ||
- **[UMD](https://github.com/umdjs/umd)**:UMD 版本可以通过 `<script>` 标签直接用在浏览器中。jsDelivr CDN 的 [https://cdn.jsdelivr.net/npm/[email protected].16](https://cdn.jsdelivr.net/npm/[email protected].16) 默认文件就是运行时 + 编译器的 UMD 版本 (`vue.js`)。 | ||
|
||
- **[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**:CommonJS 版本用来配合老的打包工具比如 [Browserify](http://browserify.org/) 或 [webpack 1](https://webpack.github.io)。这些打包工具的默认文件 (`pkg.main`) 是只包含运行时的 CommonJS 版本 (`vue.runtime.common.js`)。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ | |
|
||
<!-- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono&display=swap" rel="stylesheet"> --> | ||
<!-- <link href="https://fonts.googleapis.com/css?family=Dosis:500&text=Vue.js&display=swap" rel="stylesheet"> --> | ||
<meta http-equiv="content-security-policy" content="script-src 'self'"> | ||
|
||
<link href="//code.bdstatic.com/npm/[email protected]/css/font-awesome.min.css" rel="stylesheet"> | ||
|
||
|
Oops, something went wrong.