Wechat applet parent-child component parameter transfer

Business requirements: Click the information list of the parent component to jump to the details page, and pass the data information in the parent component to the details page.
insert image description here

parent component configuration

  1. In the index.wxml file:data-item="{ {item}}"
    insert image description here

  2. In index.js: url: "/pages/order/order-detail/index?dataList=" + dataList
    insert image description here
    [Note]: This is the transfer of complex data types, so use json.stringify and json.parse for type conversion.

subcomponent configuration

  1. Received in index.js:onLoad函数中接收
    insert image description here

Guess you like

Origin blog.csdn.net/qq_43483403/article/details/122684774