我试图在Window.Open中发送下面的JSON对象,但是当我尝试检索它时,却得到了
“ [对象对象]”
@track InputValues = {
strName: "test",
strAddress: "test",
strCountry: "test",
strCode: "1",
strNumber: "1"
};
window.open("/c/testApp.app?recordId="+this.recordId +"&getallinputs="+this.InputValues,'_blank');
Aura testApp
<aura:application extends="force:slds" access="GLOBAL" implements="force:appHostable,force:hasRecordId">
<aura:attribute name="recordId" type="String" default="123"/>
<aura:attribute name="getallinputs" type="String"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<c:test recordId="{!v.recordId}" jsonDetails="{!v.getallinputs}"/>
</aura:application>
在接收LWC结束时-
renderedCallback() {
this.dataJson = JSON.stringify(this.InputValues);
}
您需要在obj周围应用JSON.stringify()才能查看它。
let inputVal = JSON.stringify(this.InputValues);
window.open("/c/testApp.app?recordId="+this.recordId +"&getallinputs="+inputVal ,'_blank');