我如何在React Native中解析肥皂数据
我如何解析React Native中的肥皂数据?我需要帮助请帮助我,如果我编写console.log(channels [0]); 是输出; 只需{
视图的内容出现在屏幕上。
constructor(props) {
super(props);
this.state = ({
channels: [],
});
}
componentDidMount() {
axios.post('xxxx', xmls, {
headers: {
'Content-Type': 'text/xml',
Accept: 'application/xml',
},
})
.then((response) => {
const channels = convert.xml2json(response.data, {alwaysArray:true,ignoreAttributes: true, compact: true, ignoreDeclaration: true, fullTagEmptyElement: true, spaces: 4 })
this.setState({ channels: [] })
console.log(channels);
})
.catch(err => console.log(err));
}
render() {
return (
<View>
{this.channels.map((v, id) => {
<View key={id}>{v.item}</View>
})}
</View>
)
}
}
How Can I Parse SOAP Data in React Native? I need help pls someone help me, i tried, if i write console.log(channels[0]);
is output;
just {
The contents of the view appear blank on the screen.
constructor(props) {
super(props);
this.state = ({
channels: [],
});
}
componentDidMount() {
axios.post('xxxx', xmls, {
headers: {
'Content-Type': 'text/xml',
Accept: 'application/xml',
},
})
.then((response) => {
const channels = convert.xml2json(response.data, {alwaysArray:true,ignoreAttributes: true, compact: true, ignoreDeclaration: true, fullTagEmptyElement: true, spaces: 4 })
this.setState({ channels: [] })
console.log(channels);
})
.catch(err => console.log(err));
}
render() {
return (
<View>
{this.channels.map((v, id) => {
<View key={id}>{v.item}</View>
})}
</View>
)
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论