Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@txdfe/at-error-page

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@txdfe/at-error-page

AT业务组件 - 异常页面

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
Maintainers
7
Weekly downloads
 
Created
Source

at-error-page


简介

AT 异常页面,有404、500、无访问权限以及默认的四种

API

提供使用 status 和 其他属性:

属性类型可选值默认值说明
statusString404 500 403null异常状态码,必传属性,如果不是这三种三种按默认类型处理
sizeStringlarge middle smalllarge页面类型
imageStringnull三种状态码默认背景图宽度固定高度自适应的图片
titleString、ReactNodenullsize为large有根据status相对应的titleTitle
descString、ReactNodenullsize为large根据status相对应的descDesc
btnPropsArraynullnull定义的按钮属性方法
linkStringnullnull错误提醒的链接

代码示例:


import ErrorPage from '@txdfe/at-error-page';

const Demo = () => {
  const props = [
    {
      type: 'normal',
      name: '返回上一页',
      onClick: () => {
        console.log('点击首个按钮');
      },
    },
    {
      type: 'primary',
      name: '返回首页',
      onClick: () => {
        console.log('点击第二个按钮');
      },
    },
  ];

  return (
    <div>
      <h4>large</h4>
      <ErrorPage status="404" title="title" desc="dec" btnProps={props} />
      <h4>middle</h4>
      <ErrorPage status="500" size="middle" title="这里是title" desc="这里是desc" />
      <h4>small</h4>
      <ErrorPage size="small" title="这里是title" desc="这里是desc" noBtn />
    </div>
  );
};

FAQs

Package last updated on 08 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc