page.tsx 1.07 KB
import { Button, Toast } from '@feewee/h5app-common';
import { Helmet } from '@modern-js/runtime/head';
import { useNavigate } from '@modern-js/runtime/router';

function Index() {
  const navigate = useNavigate();

  return (
    <>
      <Helmet>
        <link rel="icon" type="image/x-icon" href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico" />
      </Helmet>
      <main className="p-4 h-screen h-svh">
        <div className="text-center">这是首页</div>
        <div className=" mt-4">
          <Button type="info" shape="round" fill="outline" className="!mx-auto !block" onClick={() => navigate('/demo')}>
            跳转页面
          </Button>

          <Button
            type="primary"
            shape="round"
            className="!mx-auto !block !mt-4"
            onClick={() =>
              Toast.show({
                content: '成功提示',
                icon: 'success',
              })
            }
          >
            吐司提示
          </Button>
        </div>
      </main>
    </>
  );
}

export default Index;