Skip to content

Commit b5afb4b

Browse files
oohirakazupon
authored andcommitted
Translate v2.6 updates for syntax.md (#1474)
* Translate v2.6 updates for syntax.md * Update src/v2/guide/syntax.md Co-Authored-By: oohira <oohira@users.noreply.github.com>
1 parent 5c92fcc commit b5afb4b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/v2/guide/syntax.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: テンプレート構文
3-
updated: 2019-02-11
3+
updated: 2019-02-13
44
type: guide
55
order: 4
66
---
@@ -129,42 +129,42 @@ Mustache は、HTML 属性の内部で使用することはできません。代
129129

130130
ここでの引数は受け取りたいイベント名です。ここからイベントハンドリングの詳細について説明します。
131131

132-
### Dynamic Arguments
132+
### 動的引数
133133

134-
> New in 2.6.0+
134+
> 2.6.0 から新規
135135
136-
Starting in version 2.6.0, it is also possible to use a JavaScript expression in a directive argument by wrapping it with square brackets:
136+
バージョン 2.6.0 から、角括弧で囲むことで JavaScript 式をディレクティブの引数に使うこともできます:
137137

138138
``` html
139139
<a v-bind:[attributeName]="url"> ... </a>
140140
```
141141

142-
Here `attributeName` will be dynamically evaluated as a JavaScript expression, and its evaluated value will be used as the final value for the argument. For example, if your Vue instance has a data property, `attributeName`, whose value is `"href"`, then this binding will be equivalent to `v-bind:href`.
142+
ここで `attributeName` JavaScript 式として動的に評価され、その評価結果が引数の最終的な値として使われます。例えば、Vue インスタンスが `"href"` という値の `attributeName` という data プロパティをもつ場合、このバインディングは `v-bind:href` と等しくなります。
143143

144-
Similarly, you can use dynamic arguments to bind a handler to a dynamic event name:
144+
同様に、動的なイベント名にハンドラをバインドするために動的引数を使うこともできます:
145145

146146
``` html
147147
<a v-on:[eventName]="doSomething"> ... </a>
148148
```
149149

150-
Similarly, when `eventName`'s value is `"focus"`, for example, `v-on:[eventName]` will be equivalent to `v-on:focus`.
150+
ここでも、例えば `eventName` の値が `"focus"` だとすると、`v-on:[eventName]` `v-on:focus` と等しくなります。
151151

152-
#### Dynamic Argument Value Constraints
152+
#### 動的引数の値の制約
153153

154-
Dynamic arguments are expected to evaluate to a string, with the exception of `null`. The special value `null` can be used to explicitly remove the binding. Any other non-string value will trigger a warning.
154+
動的引数は、`null` を除くと string に評価されることが想定されています。特殊値 `null` は、明示的にバインディングを削除するのに使われます。その他の string 以外の値は、警告を引き起こします。
155155

156-
#### Dynamic Argument Expression Constraints
156+
#### 動的引数の式の制約
157157

158-
<p class="tip">Dynamic argument expressions have some syntax constraints because certain characters are invalid inside HTML attribute names, such as spaces and quotes.</p>
158+
<p class="tip">動的引数の式には構文上の制約があります。というのも、スペースや引用符のような一部の文字は、HTML の属性名としては不正な文字だからです。</p>
159159

160-
For example, the following is invalid:
160+
例えば、以下は不正です:
161161

162162
``` html
163-
<!-- This will trigger a compiler warning. -->
163+
<!-- これはコンパイラ警告を引き起こします -->
164164
<a v-bind:['foo' + bar]="value"> ... </a>
165165
```
166166

167-
The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property.
167+
回避策は、スペースや引用符を含まない式を使うか、複雑な式を算出プロパティで置き換えるかです。
168168

169169
### 修飾子
170170

@@ -189,7 +189,7 @@ The workaround is to either use expressions without spaces or quotes, or replace
189189
<!-- 省略記法 -->
190190
<a :href="url"> ... </a>
191191

192-
<!-- shorthand with dynamic argument (2.6.0+) -->
192+
<!-- 動的引数の省略記法 (2.6.0 以降) -->
193193
<a :[key]="url"> ... </a>
194194
```
195195

@@ -202,7 +202,7 @@ The workaround is to either use expressions without spaces or quotes, or replace
202202
<!-- 省略記法 -->
203203
<a @click="doSomething"> ... </a>
204204

205-
<!-- shorthand with dynamic argument (2.6.0+) -->
205+
<!-- 動的引数の省略記法 (2.6.0 以降) -->
206206
<a @[event]="doSomething"> ... </a>
207207
```
208208

0 commit comments

Comments
 (0)