import React, { MouseEvent } from 'react'; import STransition from '@components/Base/STransition'; import SIcon from '@components/SIcon'; import "./style.less"; interface State { visible: boolean; animation: string; } class Page extends React.Component<{}, State> { constructor(props: {}) { super(props); this.state = { visible: false, animation: 'fade' }; this.handleClick1 = this.handleClick1.bind(this); this.handleClick2 = this.handleClick2.bind(this); } render() { const { visible, animation } = this.state; return (

this.handleClick1()}>fade效果

Hello world

this.handleClick2()}>alert效果

); } handleClick1() { this.setState({ visible: !this.state.visible, animation: 'fade' }); } handleClick2() { this.setState({ visible: !this.state.visible, animation: 'alert' }); } } export default Page;