父组件给子组件传递一个对象item,发现用方法一的时候子组件中接收到的item里每个属性都会多出get/set方法,如果属性比较多方法二太烦了,请教大神们是怎么做的方法一:<img-box :obj='item'></img-box>方法二:<img-box :value='item.value' :activeParam='item.activeParam' :aimUrl='item.aimUrl' :jumpType='item.jumpType' :setTop='item.setTop' :setWidth='item.setWidth' :themeId='item.themeId' :todocode='item.todocode' :toolId='item.toolId' :ttid='item.ttid' ></img-box>
1 回答
料青山看我应如是
TA贡献1772条经验 获得超8个赞
<img-box :obj='item'></img-box>
let {value, activeParam, aimUrl, jumpType, setTop, setWidth, themeId, todocode, toolId, ttid} = item;
添加回答
举报
0/150
提交
取消