Skip to content

Commit ab84ef5

Browse files
committed
fix: apply feedback
1 parent e873074 commit ab84ef5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/guide/typescript-support.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ vue add typescript
5353

5454
### エディタによるサポート
5555

56-
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[シングルファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。
56+
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[単一ファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。
5757

5858
[WebStorm](https://www.jetbrains.com/webstorm/) もすぐに利用できる TypeScript と Vue のサポートを提供しています。
5959

@@ -86,7 +86,7 @@ const Component = defineComponent({
8686
})
8787
```
8888

89-
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
89+
複雑な型や推論の場合、[タイプアサーション (type assertion)](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
9090

9191
```ts
9292
interface Book {
@@ -140,7 +140,7 @@ const Component = defineComponent({
140140
})
141141
```
142142

143-
### プロパティにアノテーションをつける
143+
### Props にアノテーションをつける
144144

145145
Vue は `type` が定義されたプロパティについてランタイムバリデーションを行います。これらの型を TypeScript に提供するため、`PropType` を伴うコンストラクタをキャストする必要があります:
146146

@@ -190,7 +190,7 @@ const Component = defineComponent({
190190

191191
setup(props) {
192192
const result = props.message.split('') // 正しいです, 'message' は文字列 (string) として型づけされます
193-
const filtered = props.message.filter(p => p.value) // エラーが起こります: 'filter' プロパティは文字列 (string) 型には存在しません。
193+
const filtered = props.message.filter(p => p.value) // エラーが起こります: Property 'filter' does not exist on type 'string'
194194
}
195195
})
196196
```
@@ -208,7 +208,6 @@ const Component = defineComponent({
208208
const year = ref(2020)
209209

210210
const result = year.value.split('') // => Property 'split' does not exist on type 'number'
211-
const result = year.value.split('') // => 'split' プロパティは 'number' 型に存在しません
212211
}
213212
})
214213
```
@@ -263,10 +262,10 @@ export default defineComponent({
263262
setup() {
264263
let count = ref(0)
265264

266-
// リードオンリー
265+
// 読み取り専用
267266
const doubleCount = computed(() => count.value * 2)
268267

269-
const result = doubleCount.value.split('') // => 'split' プロパティは 'number' 型に存在しません。
268+
const result = doubleCount.value.split('') // Property 'split' does not exist on type 'number'
270269
}
271270
})
272271
```

0 commit comments

Comments
 (0)