Small micro-channel application developers a set of tools warning process

1, prompted setdata change datasets For developer: Do not set same key "[object Object]" in wx:. Key jump pit

 

Applet prompts setdata change datasets For developer: Do not set same key "[object Object]" in wx:. Key
first I thought dataset error, check the network and then think of the data set is rendered by a for loop in for when you need to set wx: key, the original code

<block wx:for="{{list}}" wx:key="*this" wx:for-item="item">

Change

<block wx:for="{{list}}" wx:key="index" wx:for-item="item">

Problem solving
is wrong to specify the object data to the wx: key this is not enough
official explained as follows:
wx: key
if the location of items in the list will dynamically change or new items added to the list, and you want to list items remain their characteristics and status (such as input content, the selected state), use wx: key to assign a unique identifier items in the list.
wx: value for key is provided in two forms
string that represents a property of the for loop in Array of item, the value of the property needs to be unique in the list of strings or numbers, and can not be changed dynamically.
* This represents the reserved keywords for circulation in the item itself, which expressed the need for item itself is a unique string or a number, such as:

When data changes trigger re-rendering render layers when will the correction with key components of the framework will ensure that they are re-ordered, rather than re-create, in order to ensure that the components retain their status, and to improve the efficiency of a list rendering.

 

2, micro-channel applet - WARNING: Invalid pageJSON (pages / circle / circle) [ "window"].

Find a reason, " .json page can be set only window-related configuration items, without having to write this key window "! ! !

{
  "usingComponents": {},
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#000",
    "NavigationBarTitleText": "My books"
    "navigationBarTextStyle": "white"
  }
}

Change


{
  "usingComponents": {},
  "backgroundTextStyle": "light",
  "navigationBarBackgroundColor": "#000",
  "NavigationBarTitleText": "My books"
  "navigationBarTextStyle": "white"
}

  

Guess you like

Origin www.cnblogs.com/wdw31210/p/12530720.html