vue2父子组件通信

前言 因为vue2去除了父子组件的双向数据绑定,所以在子组件是不允许修改父组件的属性的,控制台会报如下错误:

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "result"(found in component )

解决办法 【vue2父子组件通信】在子组件data中定义一个父组件传递过来的副本,再把该副本利用this.$emit("","")给传回去,父组件利用自定义事件接受该值
子组件

父组件
.index position: relative height: 100% .content overflow: auto overflow-x: hidden padding-bottom: 45px .footer position: fixed bottom: 0 height: 45px width: 100%```

    推荐阅读