vuejs组件通信
<body><div id="example"><father></father></div>
</body>
<script>Vue.component('child', {// 聲明 props
props: ['message'],// 就像 data 一樣,prop 可以用在模板內(nèi)// 同樣也可以在 vm 實(shí)例中像 “this.message” 這樣使用
template: '<span>{{ message }}</span>'})Vue.component('father', {template: '<child message="hello!"></child>'})new Vue({el: '#example'})
</script></html>
?
轉(zhuǎn)載于:https://www.cnblogs.com/thankyouGod/p/6681615.html
總結(jié)
- 上一篇: Java笔试题大全(附带答案)
- 下一篇: Vue中import引入模块路径时的@符