Last active
September 11, 2016 05:36
-
-
Save Panigale/14fb6aa823acd199c53dddcb0406692c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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