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

@antdp/basic-layouts

Package Overview
Dependencies
Maintainers
2
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antdp/basic-layouts

入口框架公共界面

  • 2.0.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-89.29%
Maintainers
2
Weekly downloads
 
Created
Source

@antdp/basic-layouts

npm npm download

入口公共界面

安装

$ npm i @antdp/basic-layouts  # yarn add  @antdp/basic-layouts

基本使用

import React from 'react';
import BasicLayouts from '@antdp/basic-layouts';
const Demo = () => {
  return (
    <BasicLayouts
      projectName="Ant Design Pro"
    />
  )
};

export default Demo

导航菜单模式

import React from 'react';
import BasicLayout from '@antdp/basic-layouts';
const Demo = () => {
  return (
    <BasicLayout
      // topleft | mix
      layout="slider"
    />
  )
};

export default Demo

菜单国际化设置

import BasicLayouts from '@antdp/basic-layouts';
import { useIntl,SelectLang } from '@umijs/max';

const Demo = () => {
  return (
    <BasicLayouts
      projectName="Ant Design Pro"
      intlLanguage={useIntl()}
      topRightLanguage={<SelectLang />}
    />
  )
};
export default Demo

配置右侧菜单

import BasicLayouts from '@antdp/basic-layouts';

export default () => {
  return (
    <BasicLayouts
      projectName="Ant Design Pro"
      topRightMenu={[
          {
            title: '个人中心',
            icon: <UserOutlined />,
            onClick: () => {},
          },
          {
            title: '个人设置',
            link: '/setting/property',
            icon: <SettingOutlined />,
          },
          {
            divider: true,
          },
          {
            title: '退出登录',
            icon: <LogoutOutlined />,
            onClick: () => {
              logout();
            },
          },
        ]}
    />
  )
};

配置暗模式

import BasicLayouts from '@antdp/basic-layouts';

export default () => {
  return (
    <BasicLayouts
      theme="dark"
      projectName="Ant Design Pro"
      topRightMenu={[
        {
          title: '个人中心',
          icon: <UserOutlined />,
          onClick: () => {},
        },
        {
          title: '个人设置',
          link: '/setting/property',
          icon: <SettingOutlined />,
        },
        {
          divider: true,
        },
        {
          title: '退出登录',
          icon: <LogoutOutlined />,
          onClick: () => {
            logout();
          },
        },
      ]}
    />
  )
};

API

参数说明类型默认值
logo项目logostring-
projectName项目名称React.ReactNode-
children自定义内容React.ReactNode-
intlLanguage国际化语言转换方法IntlShape
topRightMenu头像下拉菜单TopRightMenuProps[]-
bodyPadding设置内容区域补白,默认 14pxnumber-
topRightLanguage顶部右方React.ReactNode-
siderWidth置最左边菜单宽度number180
profile用户信息显示{avatar?: string;name?: string}-
theme明暗主题dark | lightlight
className样式string-
configProviderPropsantd组件全局化配置ConfigProviderProps-
layout导航菜单模式,slider:右侧导航,topleft:顶部左侧导航,mix:混合导航LayoutModelmix

TopRightMenuProps

参数说明类型默认值
icon图标React.ReactNode-
title标题React.ReactNode-
link链接string-
divider是否有下划线boolean-
onClick点击事件IntlShape

Keywords

FAQs

Package last updated on 12 Jun 2023

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