Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 7d632f8

Browse files
committed
Merge branch 'main' of github.com:vuejs-jp/learn.nuxt.com
2 parents cacdd93 + 8050ebe commit 7d632f8

File tree

14 files changed

+40
-23
lines changed

14 files changed

+40
-23
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: pnpm
2727

2828
- name: Install
29-
run: pnpm install
29+
run: pnpm install --frozen-lockfile
3030

3131
- name: Lint
3232
run: pnpm run lint --fix

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cache: pnpm
2222

2323
- name: Install
24-
run: pnpm install
24+
run: pnpm install --frozen-lockfile
2525

2626
- name: Typecheck
2727
run: pnpm run typecheck

content/1.vue/1.index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
ogImage: true
33
---
44

5-
# Vue Basics
5+
# Vueの基本
66

7-
Nuxt integrates [Vue 3](https://vuejs.org/), a progressive framework for building user interfaces. In this section, we will cover the basics of Vue.
7+
Nuxt は、[Vue 3](https://vuejs.org/)というユーザーインターフェイスを構築するためのプログレッシブなフレームワークを使用しています。このセクションでは、Vue の基本について説明します。\
8+
エディタに表示されているのは、[Vueシングルファイルコンポーネント](https://vuejs.org/guide/scaling-up/sfc.html)(SFC)です。
89

9-
What you see in the editor is a [Vue Single-File Component](https://vuejs.org/guide/scaling-up/sfc.html) (SFC).
10+
SFC は、HTML、CSS、および JavaScript を 1 つの `.vue` ファイル内にまとめた再利用可能な自己完結型のコードブロックです。これは、JavaScript ロジックを定義するための[`<script setup>`](https://vuejs.org/api/sfc-script-setup.html)ブロック、HTML テンプレートを定義するための `<template>` ブロック、および CSS スタイルを定義するためのオプションの `<style>` ブロックで構成されています。右側のプレイグラウンドで実際に操作してみるか、[公式のVueドキュメント](https://v3.vuejs.org/guide/single-file-component.html)で詳細を読むことができます。
1011

11-
An SFC is a reusable self-contained block of code that encapsulates HTML, CSS and JavaScript that belong together, written inside a `.vue` file. It's composed with a [`<script setup>`](https://vuejs.org/api/sfc-script-setup.html) block to define the JavaScript logic, a `<template>` block to define the HTML template and optional `<style>` blocks to define the CSS style. You can play with it using the playground on the right, or read more about it in the [official Vue documentation](https://v3.vuejs.org/guide/single-file-component.html).
12-
13-
In Nuxt, we support Vue SFC out-of-the-box and highly recommend you to use it to build your application. One thing that is different from Vue's default Vue SFC is that in Nuxt we [auto-import the Vue utilities](https://nuxt.com/docs/guide/concepts/auto-imports) for you, so you can use `ref`, `computed` and other Vue APIs directly without importing them.
12+
Nuxt では、Vue SFC をそのままサポートしており、アプリケーションを構築するために使用することを強くお勧めします。Nuxt が Vue のデフォルトの Vue SFC と異なる点の 1 つは、[Vueユーティリティを自動インポート](https://nuxt.com/docs/guide/concepts/auto-imports)することです。そのため、`ref``computed` などの Vue API を直接インポートせずに使用することができます。
1413

1514
::note
16-
**Tips**: You might have heard that there are a few different ways to define a Vue component. In general, we recommend using [`<script setup>`](https://vuejs.org/api/sfc-script-setup.html) with [Composition API](https://vuejs.org/guide/introduction.html#composition-api) to get the best developer experience. If you are new to Vue, don't worry too much about understanding all different choices, you can follow what we recommend as we believe it's also the most intuitive way to get started with Vue.
15+
**ヒント**: Vue コンポーネントを定義する方法はいくつかありますが、一般的には[Composition API](https://vuejs.org/guide/introduction.html#composition-api)を使用した[`<script setup>`](https://vuejs.org/api/sfc-script-setup.html)を使用することをお勧めします。これにより、より良い開発者体験を得ることができます。Vue を初めて使用する場合、異なる選択肢をすべて理解することにこだわる必要はありません。私たちの推奨する方法を採用すれば、最も直感的に Vue を始められるでしょう。
1716
::
1817

19-
Going forward, we will cover the following topics:
18+
今後、以下のトピックについて説明します:
2019

2120
- [Reactivity](/vue/reactivity)
2221
- [Composition API](/vue/composition-api)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Challenge

content/1.vue/4.composition-api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Nuxt では、`composables/` ディレクトリに Composables なロジック
1515
それでは、これらの特徴を踏まえて以下のステップでロジックを Composables として切り出し、再利用してみましょう。
1616

1717
1. 既存の vue ファイル(`app.vue`)の確認してください。
18-
2. カウンターロジックを Composable として切り出してください。具体的には `composables/` フォルダを作成し、その中に `useCounter.ts` というファイルを作成してください
18+
2. カウンターロジックを `composables/useCounter.ts` に切り出してください
1919
3. `app.vue` に 2 で切り出したロジックを適用してください。
2020

2121
## ヒント

content/1.vue/5.summary/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Vue Basics Summary
1+
# Vueの基本のまとめ
22

3-
Great! You've learned the basics of Vue. If you are interested in learning more about Vue, check out the [official Vue documentation](https://vuejs.org/) for more in-depth guides and tutorials.
3+
おめでとうございます!これで Vue の基本を学び終わりました。さらに Vue について学びたい場合は、[公式のVueドキュメント](https://vuejs.org/)をご覧ください。より詳しいガイドやチュートリアルが用意されています。
44

5-
Up next, let's start to explore how Nuxt would make your development experience even better.
5+
次は、Nuxt がどのようにあなたの開発体験をさらに向上させるかを見ていきましょう。
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Challenge -->

content/2.concepts/3.routing/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ console.log(route.params.id)
3838

3939
## チャレンジ
4040

41-
`/posts/[id]` というルートを作成し`/`, `/foo` からナビゲーション出来るように実装してみましょう。
41+
`/posts/[id]` というルートに対して`/`, `/foo` からナビゲーション出来るように実装してみましょう。
4242
`/posts/[id]` では、ルートパラメータから `id` を読み取り、その値を画面に表示してみましょう。
4343

4444
そのためには:
4545

46-
1. `pages` ディレクトリに `posts` ディレクトリを作成します。
47-
2. `pages/posts` ディレクトリ内に `[id].vue` ファイルを作成します。
48-
3. `[id].vue` ファイル内で `useRoute()` を使って params から `id` を取得し、画面に表示します。
49-
4. `pages/index.vue``pages/foo.vue``<NuxtLink>` コンポーネントを使って `/posts/[id]` にナビゲーションするリンクを作成します。\
46+
1. `pages/posts/[id].vue` ファイル内で `useRoute()` を使って params から `id` を取得し、画面に表示します。
47+
2. `pages/index.vue``pages/foo.vue``<NuxtLink>` コンポーネントを使って `/posts/[id]` にナビゲーションするリンクを作成します。\
5048
ここでは例として、`/posts/1` にナビゲーションするリンクを作成してみましょう。\
5149
(実際には値は任意のもので構いません)
5250

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Challenge

content/2.concepts/4.auto-imports/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default defineNuxtConfig({
4343

4444
## チャレンジ
4545

46-
実際に utils ディレクトリを作成して、Auto Import 可能な関数を実装してみましょう。
46+
実際に utils/double.ts ファイルに対して、Auto Import 可能な関数を実装してみましょう。
4747

4848
関数は任意のもので構いませんが、例として「与えられた数値を二倍にして返す `double()` 関数」を実装してみましょう。\
4949
関数が実装できたら、`app.vue` 内の template で使用して、2 倍された数値を画面に表示してみましょう。

0 commit comments

Comments
 (0)