Skip to content

[Doc]: fix: should pin major version in CDN links #2240 #2248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/v2/guide/comparison.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 他のフレームワークとの比較
updated: 2020-01-07
updated: 2020-11-07
type: guide
order: 801
---
Expand Down Expand Up @@ -108,7 +108,7 @@ React はその急な学習曲線で有名です。あなたが本当に始め
React と同じように Vue は規模を大きくできますし、一方で、jQuery のように規模を小さくすることもできます。そうです - 使い始めるにあたって、あなたはページの中に 1 つの script タグを放り込むだけで良いのです:

``` html
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
```

これであなたは Vue のコードを書き始めることができますし、後ろめたい思いをしたり性能問題について心配したりすることなく、ミニファイ(minify)版をプロダクション環境へ設置することもできます。
Expand Down
8 changes: 4 additions & 4 deletions src/v2/guide/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: はじめに
updated: 2020-03-20
updated: 2020-11-07
type: guide
order: 2
---
Expand All @@ -25,14 +25,14 @@ Vue.js を試すには、[Hello World example](https://codesandbox.io/s/github/v

``` html
<!-- 開発バージョン、便利なコンソールの警告が含まれています -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
```

or:

``` html
<!-- 本番バージョン、サイズと速度のために最適化されています -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
```

Vue の他のインストール方法について、[インストール](../guide/installation.html) ページで紹介しています。注意点として、初心者が `vue-cli` で始めることは推奨**しません**(特に、Node.js ベースのツールについてまだ詳しくない場合)。
Expand Down Expand Up @@ -322,7 +322,7 @@ Vue.component('todo-item', {
``` html
<div id="app-7">
<ol>
<!--
<!--
各 todo-item の内容を表す todo オブジェクトを与えます。
これにより内容は動的に変化します。
また後述する "key" を各コンポーネントに提供する必要があります。
Expand Down
8 changes: 4 additions & 4 deletions src/v2/guide/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: インストール
updated: 2020-06-14
updated: 2020-11-07
type: guide
order: 1
vue_version: 2.5.16
Expand Down Expand Up @@ -42,7 +42,7 @@ Vue を使用する場合は、ブラウザに [Vue Devtools](https://github.com
プロトタイピングや学習を目的とする場合は、以下のようにして最新バージョンを使うことができます:

``` html
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
```

本番環境では、新しいバージョンによる意図しない不具合を避けるため、特定のバージョン番号とビルド番号にリンクすることをお勧めします:
Expand Down Expand Up @@ -85,7 +85,7 @@ $ npm install vue

## さまざまなビルドについて

[NPM パッケージの `dist/` ディレクトリ](https://cdn.jsdelivr.net/npm/vue/dist/) では Vue.js の多くのさまざまなビルドが見つかります。それらの違いの概要は以下の通りです:
[NPM パッケージの `dist/` ディレクトリ](https://cdn.jsdelivr.net/npm/vue@2/dist/) では Vue.js の多くのさまざまなビルドが見つかります。それらの違いの概要は以下の通りです:

| | UMD | CommonJS | ES Module (バンドラ用) | ES Module (ブラウザ用) |
| --- | --- | --- | --- | --- |
Expand All @@ -102,7 +102,7 @@ $ npm install vue

- **ランタイム**: Vue インスタンスの作成やレンダリング、仮想 DOM の変更などのためのコードです。基本的にコンパイラを除く全てのものです。

- **[UMD](https://github.com/umdjs/umd)**: UMD ビルドは `<script>` タグによってブラウザに直接利用されます。[https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue) の jsDelivr CDN からの既定のファイルは ランタイム + コンパイラ UMD ビルド (`vue.js`) です。
- **[UMD](https://github.com/umdjs/umd)**: UMD ビルドは `<script>` タグによってブラウザに直接利用されます。[https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue@2) の jsDelivr CDN からの既定のファイルは ランタイム + コンパイラ 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`) です。

Expand Down
14 changes: 7 additions & 7 deletions src/v2/guide/typescript.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TypeScript のサポート
updated: 2020-05-10
updated: 2020-11-07
type: guide
order: 403
---
Expand All @@ -11,7 +11,7 @@ order: 403

静的型システムは、特にアプリケーションが成長するに伴い、多くの潜在的なランタイムエラーを防止するのに役立ちます。そのため、Vue は [TypeScript](https://www.typescriptlang.org/) 向けに[公式型宣言](https://github.com/vuejs/vue/tree/dev/types)を提供しており、Vue コアだけでなく [Vue Router](https://github.com/vuejs/vue-router/tree/dev/types) と [Vuex](https://github.com/vuejs/vuex/tree/dev/types) も同様に提供しています。

これらは [NPM に公開](https://cdn.jsdelivr.net/npm/vue/types/)されており、そして最新の TypeScript は NPM パッケージ内の型宣言を解決する方法を知っています。つまり、NPM でインストールした時、TypeScript を Vue と共に使うための追加のツールを必要としません。
これらは [NPM に公開](https://cdn.jsdelivr.net/npm/vue@2/types/)されており、そして最新の TypeScript は NPM パッケージ内の型宣言を解決する方法を知っています。つまり、NPM でインストールした時、TypeScript を Vue と共に使うための追加のツールを必要としません。

## 推奨構成

Expand Down Expand Up @@ -63,17 +63,17 @@ import Vue from 'vue'
const Component = Vue.extend({
// 型推論を有効にする
})

const Component = {
// これは型推論を持っていません、
// なぜなら、これは Vue コンポーネントのオプションであるということを伝えることができないためです。
}
```

## クラススタイル Vue コンポーネント

コンポーネントを宣言するときにクラスベース API を使用する場合は、公式にメンテナンスされている [vue-class-component](https://github.com/vuejs/vue-class-component) のデコレータを使用できます:

``` ts
import Vue from 'vue'
import Component from 'vue-class-component'
Expand Down Expand Up @@ -193,7 +193,7 @@ const Component = Vue.extend({
```ts
import Vue, { PropType } from 'vue'

interface ComplexMessage {
interface ComplexMessage {
title: string,
okMessage: string,
cancelMessage: string
Expand All @@ -202,7 +202,7 @@ const Component = Vue.extend({
props: {
name: String,
success: { type: String },
callback: {
callback: {
type: Function as PropType<() => void>
},
message: {
Expand Down