[Vue warn]: Error in render: “TypeError: Cannot convert undefined or null to object“found in--->
[Vue warn]: Error in render: "TypeError: Cannot convert undefined or null to object"TypeError: Cannot convert undefined or null to objectat Function.keys (<anonymous>) 代码<script>export def
·
[Vue warn]: Error in render: "TypeError: Cannot convert undefined or null to object"
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
代码
<script>
export default {
name: "",
props: {
goods: {
type: Object,
},
},
data() {
return {};
},
methods: {},
};
</script>
错误原因是,我这个组件要从props里面拿goods去渲染,但是我穿过来的时候,另一边给的默认值是null,所以会报这个错 = =
这个是父组件
data() {
return {
topImages: null,
goods: null,
};
},
只要把默认的null改成{}就可以
更多推荐
已为社区贡献2条内容
所有评论(0)