我有2个组件TermsOfServices
,在2个父组件中使用。父组件之一是我的ReadTosPage
组件。我的子组件中有一个按钮,该按钮根据放置它的页面数来管理图标的有条件显示。我只想更改在父ReadTosPage
组件中带有复选图标的按钮的行为,以便它关闭页面而不发送任何信息。只需关闭页面即可。我该怎么办?谢谢
我的FAB
中的TermsOfServices
按钮:
<Fab position="right-bottom" slot="fixed" color="pink" onClick={() => this.handleNext()}>
{currentTosId + 1 === termsOfServices.length &&
<Icon ios="f7:check" aurora="f7:check" md="material:check" />}
{currentTosId !== termsOfServices.length &&
<Icon ios="f7:chevron_right" aurora="f7:chevron_right" md="material:chevron_right" />}
</Fab>
ReadTosPage
:
import React, { PureComponent } from 'react';
import { intlShape } from 'react-intl';
import {
Page,
Navbar,
Block,
} from 'framework7-react';
import TermsOfServices from '../components/TermsOfServices';
class ReadTosPage extends PureComponent {
static contextTypes = {
intl: intlShape,
};
render() {
const { intl } = this.context;
const { formatMessage } = intl;
return (
<Page>
<Navbar backLink title={formatMessage({ id: 'press_yui_tos_title' })} />
<Block>
<TermsOfServices />
</Block>
</Page>
);
}
}
export default ReadTosPage;