赞
踩
04文件夹,wecaht
vue create wechat,创建文件
:userlist=“userlist”,组件userlist-com获取App.vue里面data数组userlist的内容
@chooseuser=‘toggleUser’,监听事件toggleUser,用来监听userlistCom.vue里面的chooseuser
//App.vue
<userlist-com @chooseuser='toggleUser' :userlist="userlist"></userlist-com
:currentUser=“currentUser”,用来获取事件toggleUser里面的currentUser值,
<chat-com :currentUser="currentUser"></chat-com>
//App.vue data(){ return { msg:'老陈聊天', userlist:[ { username:"小明", headerimg:require('./assets/img/1.jpeg') }, { username:"小黑", headerimg:require('./assets/img/2.jpeg') }, { username:"小红", headerimg:require('./assets/img/3.jpg') },{ username:"小白", headerimg:require('./assets/img/4.jpeg') } ], currentUser:{ username:"小明"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。