Skip to content

Instantly share code, notes, and snippets.

@Panigale

Panigale/props

Last active Sep 11, 2016
Embed
What would you like to do?
<div id="parents">
<h3>子組件內容:</h3>
<child :message="parentsMessage"></child>
</div>
<script>
//定義子組件
Vue.component('child', {
props:['message'],
template: '<div>{{ message }}</div>'
})
//建立父組件
new Vue({
el: '#parents',
data:{
parentsMessage:'hello, my child'
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment