我正在尝试解析Template来解析json文件。如何获得class Modal extends React.Component {
render() {
const {open, passengerId, passengerInfo} = this.props;
if(!open) return null; // if the state is not open, don't render anything
const info = passengerInfo[passengerId]; // otherwise get the info using the id
return (
<OptionsModal>
<AllPassengersOptionsModal
id={info.id}
//... other things
/>
</OptionsModal>
)
}
}
// change depending on your redux state
export default connect(state => ({
open: state.foo.allPassengersDropOffOptionsPopup, // modified by the reducer above
passengerId: state.foo.visiblePassengerId, // modified by the reducer above
passengerInfo: state.bar.passengerInfo // all passengers info, we will get the one using passengerId
},
dispatch => (
// add as you need them
)
))(Modal)
值作为数组?
这是示例JSON内容:
flowVars
"fields": [
{ "terms": { "asset_category": ["Video"] } },
{ "terms": { "product_Id": #[flowVars.ProductId] } }
]
作为查询参数,逗号分隔为“ 1234”,“ 2345”
但是在解析模板中,我必须按如下方式获取它
ProductId