使用 Onsen playground & React Combining Navigator 和 Tabbar 示例,我做了这个 - https://media.giphy.com/media/fjxPFluObAs5P3cXms/giphy.gif
我想更改添加更多用户的按钮和输入字段的位置,所以我使用了 fab。每当我打电话给navigator.pushPage
它时,它都会说TypeError: navigator.pushPage is not a function
。
其背后的代码是:
fabHandleClick() {
navigator.pushPage({ component: ItemForm, props: { key: 'itemForm' } });
}
render() {
return (
<Page>
<List
dataSource={this.props.users}
renderRow={this.renderList.bind(this, this.props.users, this.props.added, "Add", true)}
/>
<br />
<hr />
<br />
<List
dataSource={this.props.added}
renderRow={this.renderList.bind(this, this.props.added, this.props.users, "Remove", false)}
/>
<Fab
onClick={this.fabHandleClick}
position='bottom right'>
<Icon icon='md-face' />
</Fab>
</Page>
);
}
提前致谢!