Skip to content

Commit 7d1a9cb

Browse files
authored
Japanese translation (Render Function section) (#44)
1 parent 15fb1c0 commit 7d1a9cb

File tree

9 files changed

+151
-151
lines changed

9 files changed

+151
-151
lines changed

.vitepress/locales/ja.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,31 +74,31 @@ export default {
7474
]
7575
},
7676
{
77-
text: 'Render Function',
77+
text: 'レンダー関数',
7878
items: [
7979
{
80-
text: 'Render Function API',
80+
text: 'レンダー関数 API',
8181
link: '/ja/breaking-changes/render-function-api'
8282
},
8383
{
84-
text: 'Slots Unification',
84+
text: 'スロットの統一',
8585
link: '/ja/breaking-changes/slots-unification'
8686
},
8787
{
88-
text: '$listeners merged into $attrs',
88+
text: '$listeners $attrs に合併',
8989
link: '/ja/breaking-changes/listeners-removed'
9090
},
9191
{
92-
text: '$attrs includes class & style',
92+
text: '$attrs class style を包含',
9393
link: '/ja/breaking-changes/attrs-includes-class-style'
9494
}
9595
]
9696
},
9797
{
98-
text: 'Custom Elements',
98+
text: 'カスタム要素',
9999
items: [
100100
{
101-
text: 'Custom Elements Interop Changes',
101+
text: 'カスタム要素の相互運用性の変更',
102102
link: '/ja/breaking-changes/custom-elements-interop'
103103
}
104104
]

src/breaking-changes/listeners-removed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Remove all usages of `$listeners`.
7070
## See also
7171

7272
- [Relevant RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0031-attr-fallthrough.md)
73-
- [Migration guide - `$attrs`includes `class` & `style` ](./attrs-includes-class-style.md)
73+
- [Migration guide - `$attrs` includes `class` & `style`](./attrs-includes-class-style.md)
7474
- [Migration guide - Changes in the Render Functions API](./render-function-api.md)
7575
- [Migration guide - New Emits Option](./emits-option.md)
7676
- [Migration guide - `.native` modifier removed](./v-on-native-modifier-removed.md)
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
title: $attrs includes class & style
2+
title: $attrs class style を包含
33
badges:
44
- breaking
55
---
66

7-
# `$attrs` includes `class` & `style` <MigrationBadges :badges="$frontmatter.badges" />
7+
# `$attrs` `class` `style` を包含 <MigrationBadges :badges="$frontmatter.badges" />
88

9-
## Overview
9+
## 概要
1010

11-
`$attrs` now contains _all_ attributes passed to a component, including `class` and `style`.
11+
`class``style` を含む、コンポーネントに渡された**すべての**属性が `$attrs` に含まれるようになりました。
1212

13-
## 2.x Behavior
13+
## 2.x の動作
1414

15-
`class` and `style` attributes get some special handling in the Vue 2 virtual DOM implementation. For that reason, they are _not_ included in `$attrs`, while all other attributes are.
15+
`class` `style` 属性は、Vue 2 の仮想 DOM の実装で特別な処理を受けます。そのため、これらは `$attrs` には含まれず、他の属性はすべて含まれます。
1616

17-
A side effect of this manifests when using `inheritAttrs: false`:
17+
この副作用は、`inheritAttrs: false` を使用したときに現れます:
1818

19-
- Attributes in `$attrs` are no longer automatically added to the root element, leaving it to the developer to decide where to add them.
20-
- But `class` and `style`, not being part of `$attrs`, will still be applied to the component's root element:
19+
- `$attrs` 内の属性は自動的にルート要素に追加されなくなり、どこに追加するかは開発者の判断に任されます。
20+
- しかし、`$attrs` に含まれない `class``style` は、今までどおりコンポーネントのルート要素に適用されます:
2121

2222
```vue
2323
<template>
@@ -32,40 +32,40 @@ export default {
3232
</script>
3333
```
3434

35-
when used like this:
35+
次のように使用すると:
3636

3737
```html
3838
<my-component id="my-id" class="my-class"></my-component>
3939
```
4040

41-
...will generate this HTML:
41+
... 以下のような HTML を生成します:
4242

4343
```html
4444
<label class="my-class">
4545
<input type="text" id="my-id" />
4646
</label>
4747
```
4848

49-
## 3.x Behavior
49+
## 3.x の動作
5050

51-
`$attrs` contains _all_ attributes, which makes it easier to apply all of them to a different element. The example from above now generates the following HTML:
51+
`$attrs` には**すべての**属性が含まれるので、すべての属性を別の要素に適用することが容易になります。先ほどの例では、次のような HTML が生成されるようになりました:
5252

5353
```html
5454
<label>
5555
<input type="text" id="my-id" class="my-class" />
5656
</label>
5757
```
5858

59-
## Migration Strategy
59+
## 移行手順
6060

61-
In components that use `inheritAttrs: false`, make sure that styling still works as intended. If you previously relied on the special behavior of `class` and `style`, some visuals might be broken as these attributes might now be applied to another element.
61+
`inheritAttrs: false` を使用しているコンポーネントでは、スタイリングが意図したとおりになっていることを確認してください。これまで `class` `style` の特別な動作に依存していた場合、これらの属性が別の要素に適用される可能性があるため、一部のビジュアルが崩れるかも知れません。
6262

63-
[Migration build flag: `INSTANCE_ATTRS_CLASS_STYLE`](../migration-build.html#compat-configuration)
63+
[移行ビルドのフラグ: `INSTANCE_ATTRS_CLASS_STYLE`](../migration-build.html#compat-configuration)
6464

65-
## See also
65+
## 参照
6666

67-
- [Relevant RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0031-attr-fallthrough.md)
68-
- [Migration guide - `$listeners` removed](./listeners-removed.md)
69-
- [Migration guide - New Emits Option](./emits-option.md)
70-
- [Migration guide - `.native` modifier removed](./v-on-native-modifier-removed.md)
71-
- [Migration guide - Changes in the Render Functions API](./render-function-api.md)
67+
- [関連 RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0031-attr-fallthrough.md)
68+
- [移行ガイド - `$listeners` の削除](./listeners-removed.md)
69+
- [移行ガイド - 新しい `emits` オプション](./emits-option.md)
70+
- [移行ガイド - `.native` 修飾子の削除](./v-on-native-modifier-removed.md)
71+
- [移行ガイド - レンダー関数 API の変更点](./render-function-api.md)

src/ja/breaking-changes/custom-elements-interop.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@ badges:
33
- breaking
44
---
55

6-
# Custom Elements Interop <MigrationBadges :badges="$frontmatter.badges" />
6+
# カスタム要素の相互運用性 <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
- **BREAKING:** The checks to determine whether tags should be treated as custom elements are now performed during template compilation, and should be configured via compiler options instead of runtime config.
11-
- **BREAKING:** Special `is` attribute usage is restricted to the reserved `<component>` tag only.
12-
- **NEW:** To support 2.x use cases where `is` was used on native elements to work around native HTML parsing restrictions, prefix the value with `vue:` to resolve it as a Vue component.
10+
- **破壊的変更:** タグをカスタム要素として扱うかどうかのチェックは、テンプレートのコンパイル時に行われるようになり、ランタイム設定ではなく、コンパイラーオプションで設定する必要があります。
11+
- **破壊的変更:** 特別な `is` 属性の使用は、予約済みである `<component>` タグにのみ制限されます。
12+
- **新機能:** ネイティブの HTML パースの制限を回避する目的で、ネイティブ要素に `is` を使用するという 2.x のユースケースをサポートするため、値の前に `vue:` を付けて Vue コンポーネントとして解決するようにします。
1313

14-
## Autonomous Custom Elements
14+
## 自主的なカスタム要素
1515

16-
If we want to add a custom element defined outside of Vue (e.g. using the Web Components API), we need to 'instruct' Vue to treat it as a custom element. Let's use the following template as an example.
16+
Vue の外部で定義されたカスタム要素を追加したい場合(例えば Web コンポーネント API を使用するなど)、Vue にカスタム要素として扱うように「指示」する必要があります。次のテンプレートを例にして説明します。
1717

1818
```html
1919
<plastic-button></plastic-button>
2020
```
2121

22-
### 2.x Syntax
22+
### 2.x の構文
2323

24-
In Vue 2.x, configuring tags as custom elements was done via `Vue.config.ignoredElements`:
24+
Vue 2.x では、タグをカスタム要素として設定するには、`Vue.config.ignoredElements` を使用していました:
2525

2626
```js
27-
// This will make Vue ignore custom element defined outside of Vue
28-
// (e.g., using the Web Components APIs)
27+
// これにより、Vue Vue の外部で定義されたカスタム要素を無視するようになります
28+
// (例: Web コンポーネント APIを使用する場合など)
2929

3030
Vue.config.ignoredElements = ['plastic-button']
3131
```
3232

33-
### 3.x Syntax
33+
### 3.x の構文
3434

35-
**In Vue 3.0, this check is performed during template compilation.** To instruct the compiler to treat `<plastic-button>` as a custom element:
35+
**Vue 3.0 では、このチェックはテンプレートのコンパイル時に行われます。** `<plastic-button>` をカスタム要素として扱うようにコンパイラーに指示するには:
3636

37-
- If using a build step: pass the `isCustomElement` option to the Vue template compiler. If using `vue-loader`, this should be passed via `vue-loader`'s `compilerOptions` option:
37+
- ビルドステップを使用する場合: Vue テンプレートコンパイラーに `isCustomElement` オプションを渡します。`vue-loader` を使用する場合は、`vue-loader``compilerOptions` オプションで渡す必要があります:
3838

3939
```js
40-
// in webpack config
40+
// webpack 設定
4141
rules: [
4242
{
4343
test: /\.vue$/,
@@ -52,83 +52,83 @@ Vue.config.ignoredElements = ['plastic-button']
5252
]
5353
```
5454

55-
- If using on-the-fly template compilation, pass it via `app.config.compilerOptions.isCustomElement`:
55+
- オンザフライのテンプレートコンパイルを使用する場合は、`app.config.compilerOptions.isCustomElement` で渡します:
5656

5757
```js
5858
const app = Vue.createApp({})
5959
app.config.compilerOptions.isCustomElement = tag => tag === 'plastic-button'
6060
```
6161

62-
It's important to note the runtime config only affects runtime template compilation - it won't affect pre-compiled templates.
62+
ランタイム設定は、ランタイムテンプレートのコンパイルにのみ影響することに注意してください。事前にコンパイルされたテンプレートには影響しません。
6363

64-
## Customized Built-in Elements {#customized-built-in-elements}
64+
## カスタマイズされたビルトイン要素 {#customized-built-in-elements}
6565

66-
The Custom Elements specification provides a way to use custom elements as [Customized Built-in Element](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example) by adding the `is` attribute to a built-in element:
66+
カスタム要素の仕様では、組み込み要素に `is` 属性を付加することで、カスタム要素を[カスタマイズされたビルトイン要素](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example)として使用する方法を提供しています:
6767

6868
```html
6969
<button is="plastic-button">Click Me!</button>
7070
```
7171

72-
Vue's usage of the `is` special attribute was simulating what the native attribute does before it was made universally available in browsers. However, in 2.x it was interpreted as rendering a Vue component with the name `plastic-button`. This blocks the native usage of Customized Built-in Element mentioned above.
72+
Vue の特別な属性 `is` の使い方は、ネイティブ属性がブラウザーで普遍的に利用できるようになる前のネイティブ属性の動作をシミュレートしていました。しかし、2.x では、`plastic-button` という名前の Vue コンポーネントをレンダリングすると解釈されました。これは、前述のカスタマイズされたビルトイン要素のネイティブな使い方をブロックしています。
7373

74-
In 3.0, we are limiting Vue's special treatment of the `is` attribute to the `<component>` tag only.
74+
3.0 では、Vue`is` 属性の特別な扱いを、`<component>` タグのみに限定しています。
7575

76-
- When used on the reserved `<component>` tag, it will behave exactly the same as in 2.x;
77-
- When used on normal components, it will behave like a normal attribute:
76+
- 予約済みである `<component>` タグで使用された場合、2.x と全く同じ動作をします。
77+
- 通常のコンポーネントで使用する場合は、通常の属性と同じように動作します:
7878

7979
```html
8080
<foo is="bar" />
8181
```
8282

83-
- 2.x behavior: renders the `bar` component.
84-
- 3.x behavior: renders the `foo` component and passing the `is` attribute.
83+
- 2.x の動作: `bar` コンポーネントをレンダリングします。
84+
- 3.x の動作: `foo` コンポーネントをレンダリングし、`is` 属性を渡します。
8585

86-
- When used on plain elements, it will be passed to the `createElement` call as the `is` attribute, and also rendered as a native attribute. This supports the usage of customized built-in elements.
86+
- プレーンな要素で使用する場合、`createElement` の呼び出しに `is` 属性として渡され、ネイティブ属性としてレンダリングされます。これは、カスタマイズされたビルトイン要素の使用をサポートします。
8787

8888
```html
8989
<button is="plastic-button">Click Me!</button>
9090
```
9191

92-
- 2.x behavior: renders the `plastic-button` component.
93-
- 3.x behavior: renders a native button by calling
92+
- 2.x の動作: `plastic-button` コンポーネントをレンダリングします
93+
- 3.x の動作: 以下を呼び出してネイティブのボタンをレンダリングします。
9494

9595
```js
9696
document.createElement('button', { is: 'plastic-button' })
9797
```
9898

99-
[Migration build flag: `COMPILER_IS_ON_ELEMENT`](../migration-build.html#compat-configuration)
99+
[移行ビルドのフラグ: `COMPILER_IS_ON_ELEMENT`](../migration-build.html#compat-configuration)
100100

101-
## `vue:` Prefix for In-DOM Template Parsing Workarounds
101+
## DOM 内テンプレートのパース回避のための `vue:` プレフィックス
102102

103-
> Note: this section only affects cases where Vue templates are directly written in the page's HTML.
104-
> When using in-DOM templates, the template is subject to native HTML parsing rules. Some HTML elements, such as `<ul>`, `<ol>`, `<table>` and `<select>` have restrictions on what elements can appear inside them, and some elements such as `<li>`, `<tr>`, and `<option>` can only appear inside certain other elements.
103+
> 注意: このセクションは、Vue のテンプレートがページの HTML に直接記述されている場合にのみ影響します。
104+
> DOM 内テンプレートを使用する場合、テンプレートはネイティブの HTML パースルールに従います。`<ul>``<ol>``<table>``<select>` などの一部の HTML 要素は、その内部に表示できる要素に制限がありますし、`<li>``<tr>``<option>` などの一部の要素は、他の特定の要素内にのみ表示できます。
105105

106-
### 2.x Syntax
106+
### 2.x の構文
107107

108-
In Vue 2 we recommended working around with these restrictions by using the `is` attribute on a native tag:
108+
Vue 2 では、ネイティブのタグに `is` 属性を使用することで、この制限を回避することを推奨していました:
109109

110110
```html
111111
<table>
112112
<tr is="blog-post-row"></tr>
113113
</table>
114114
```
115115

116-
### 3.x Syntax
116+
### 3.x の構文
117117

118-
With the behavior change of `is`, a `vue:` prefix is now required to resolve the element as a Vue component:
118+
`is` の動作変更に伴い、要素を Vue コンポーネントとして解決するには `vue:` プレフィックスが必要になりました:
119119

120120
```html
121121
<table>
122122
<tr is="vue:blog-post-row"></tr>
123123
</table>
124124
```
125125

126-
## Migration Strategy
126+
## 移行手順
127127

128-
- Replace `config.ignoredElements` with either `vue-loader`'s `compilerOptions` (with the build step) or `app.config.compilerOptions.isCustomElement` (with on-the-fly template compilation)
128+
- `config.ignoredElements` は、ビルドステップの場合は `vue-loader``compilerOptions` に置き換え、オンザフライのテンプレートコンパイルの場合は `app.config.compilerOptions.isCustomElement` に置き換えます。
129129

130-
- Change all non-`<component>` tags with `is` usage to `<component is="...">` (for SFC templates) or prefix it with `vue:` (for in-DOM templates).
130+
- `<component>` 以外で `is` が使われているタグは、SFC テンプレートの場合は `<component is="...">` に変更し、DOM 内テンプレートの場合は `vue:` プレフィックスを付けます。
131131

132-
## See Also
132+
## 参照
133133

134-
- [Guide - Vue and Web Components](https://ja.vuejs.org/guide/extras/web-components.html)
134+
- [ガイド - Vue Web コンポーネント](https://ja.vuejs.org/guide/extras/web-components.html)

src/ja/breaking-changes/emits-option.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ export default {
9393
- [関連 RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0030-emits-option.md)
9494
- [移行ガイド - `.native` 修飾子の削除](./v-on-native-modifier-removed.md)
9595
- [移行ガイド - `$listeners` の削除](./listeners-removed.md)
96-
- [移行ガイド - `$attrs``class``style` を含有](./attrs-includes-class-style.md)
96+
- [移行ガイド - `$attrs``class``style` を包含](./attrs-includes-class-style.md)
9797
- [移行ガイド - レンダー関数 API の変更点](./render-function-api.md)

src/ja/breaking-changes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
- [レンダー関数の API が変更されました](./render-function-api.html)
3232
- [`$scopedSlots` プロパティーは削除され、すべてのスロットが `$slots` で関数として公開されます](./slots-unification.html)
33-
- [`$listeners` は削除され、`$attrs` に統合されました](./listeners-removed)
33+
- [`$listeners` は削除され、`$attrs` に合併されました](./listeners-removed)
3434
- [`$attrs` には `class``style` 属性が含まれるようになりました](./attrs-includes-class-style.md)
3535

3636
### カスタム要素

0 commit comments

Comments
 (0)