File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
title : コンポーネント
3
- updated : 2017-12-03
3
+ updated : 2018-03-09
4
4
type : guide
5
5
order : 11
6
6
---
@@ -292,13 +292,22 @@ Vue.component('child', {
292
292
式に通常の属性をバインディングするのと同様に、 ` v-bind ` を使用して親のデータにプロパティを動的にバインディングすることもできます。親でデータが更新される度に、そのデータが子に流れ落ちます:
293
293
294
294
``` html
295
- <div >
295
+ <div id = " prop-example-2 " >
296
296
<input v-model =" parentMsg" >
297
297
<br >
298
298
<child v-bind:my-message =" parentMsg" ></child >
299
299
</div >
300
300
```
301
301
302
+ ``` js
303
+ new Vue ({
304
+ el: ' #prop-example-2' ,
305
+ data: {
306
+ parentMsg: ' Message from parent'
307
+ }
308
+ })
309
+ ```
310
+
302
311
` v-bind ` のための省略記法を使用するとよりシンプルです:
303
312
304
313
``` html
@@ -322,7 +331,7 @@ new Vue({
322
331
components: {
323
332
child: {
324
333
props: [' myMessage' ],
325
- template: ' <span>{{myMessage}}</span>'
334
+ template: ' <span>{{ myMessage }}</span>'
326
335
}
327
336
}
328
337
})
You can’t perform that action at this time.
0 commit comments