父
<infolist channel="oldhouse" style="info-list-img">
.......
</infolist>
子
<template>
.....
<div :class="style">
.....
</template>
<script>
import axios from 'axios'
export default {
props:["channel","style"],
报错:
channel可以正常传过来,style却不行。如果有把style修改为styles就可以了,难道是保留字?
是的, 错误翻一下就是
style是保留属性不能作为component的prop