亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue子組件通過事件向父級組件發送消息怎么不成功啊

vue子組件通過事件向父級組件發送消息怎么不成功啊

LEATH 2018-09-23 16:55:17
初學vue,照著官網實例敲的,怎么點擊按鈕字體沒有變大啊Html代碼:<body><div id="blog-posts-events-demo">     <div :style="{ fontSize: postFontSize + 'em' }">         <blog-post                 v-for="post in posts"                 v-bind:key="post.id"                 v-bind:post="post"         ></blog-post>     </div></div></body>js代碼 Vue.component('blog-post', {         props: ['post'],         template: `     <div class="blog-post" v-on:enlarge-text="postFontSize+=0.1">       <h3>{{ post.title }}</h3>       <button v-on:click="$emit('enlarge-text')">         Enlarge text       </button>       <div v-html="post.content"></div>     </div>`     })          let a = new Vue({         el: '#blog-posts-events-demo',         data: {             posts: [                 {id: 1, content: 'My journey with Vue', title: '1'},                 {id: 2, content: 'Blogging with Vue', title: '2'},                 {id: 3, content: 'Why Vue is so fun', title: '3'}             ],             postFontSize: 1         }     })
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 529 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號