[Vue.js]親から子へデータを渡す
1229 ワード
html
<div id="app">
<hello message="come on!!!"></hello>
</div>
vue.js
Vue.component('hello',{
props:['message'],
template:'<p>{{message}}</p>',
})
var app = new Vue({
el:'#app',
})
ブラウザ
come on!!!
もっと直感的に書けるのがslot
html
<div id="app">
<hello>
うわああああああああああああああああああああああああああああああああ
</hello>
</div>
Vue.js
Vue.component('hello',{
template:'<p><slot></slot></p>',
})
var app = new Vue({
el:'#app',
})
ブラウザ
うわああああああああああああああああああああああああああああああああ
Author And Source
この問題について([Vue.js]親から子へデータを渡す), 我々は、より多くの情報をここで見つけました https://qiita.com/t_109609akg/items/6108bf9ea424d1da4d69著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .