2021
05-23
05-23
vue父子组件的互相传值和调用
1、父传值给子组件父组件:<template><div><pclass="father">父组件</p><child:sid="id"></child></div></template><script>importchildfrom'./child'exportdefault{components:{child},data(){return{id:'1234'//父组件向子组件传的值}}}</script>子组件:<template><div><pclass="child">子组件</p><pclass="child">接收父组件的值是:{{sid}}</p></div></te...
继续阅读 >