参考: https://blog.csdn.net/aliven1/article/details/80743470 https://blog.csdn.net/liang377122210/article/details/78880438 https://blog.csdn.net/goodaxuan/article/details/82113123 main.js文件中: var store = new Vuex.Store({ state: { user
父向子组件传参 例子:App.vue为父,引入componetA组件之后,则可以在template中使用标签(注意驼峰写法要改成componet-a写法,因为html对大小写不敏感,componenta与componentA对于它来说是一样的,不好区分,所以使用小写-小写这种写法).而子组件componetA中,声明props参数'msgfromfa'之后,就可以收到父向子组件传的参数了.例子中将msgfromfa显示在<p>标签中.App.vue中 1 1<component-a ms