unshift后setdata问题?
在wx:key下,用unshift向数组前边插入个对象,为什么渲染出来后这个对象却是在最后边?小白求解,难道wx:key的意思就是固定了之前的排序?
< view title = "{{item.tabName}}" wx:for = "{{myTabs}}" wx:key = "tabId" disabled = "{{item.disabled}}" wx:for-index = "tabindex" >... |
this .data.myTabs.unshift({ "tabName" : "XX" , "tabId" : 1, "rule" : Object.assign({ "page" : 1 }, this .data.lookforpara), pageWrapCount: [], ismore: true , disabled: false , system: false , path: null }) this .setData({ myTabs: this .data.myTabs }) |