首页 > 其他分享 >Ant Design的基本使用

Ant Design的基本使用

时间:2023-05-01 20:25:24浏览次数:49  
标签:基本 ant Ant design import MyComponent Design

title: 08-Ant Design的基本使用
publish: true

andt 的介绍

Ant Design 是基于 React 实现,开发和服务于企业级后台产品。

支持环境

  • 现代浏览器和 IE9 及以上(需要 polyfills)。

  • 支持服务端渲染。

  • Electron

Electron(原名为Atom Shell)是GitHub开发的一个开源框架。 它允许使用Node.js(作为后端)和Chromium(作为前端)完成桌面GUI应用程序的开发。

很多客户端软件都是基于 Electron 开发的。比如 VS Code。我们打开 VS Code 菜单栏的 “帮助 --> 切换开发人员工具”,就会看到类似于 chrome的调试工具。

相关链接

andt 的使用

环境安装

npm install antd --save

代码示例

我们需要什么组件,就导入该组件即可。

(1)index.html:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 容器,通过 React 渲染得到的 虚拟DOM,会呈现到这个位置 -->
  <div id="app"></div>
</body>

</html>

(2)main.js:

// JS打包入口文件
// 1. 导入包
import React from "react";
import ReactDOM from "react-dom";

import MyComponent from "./components/MyComponent.jsx";

// 使用 render 函数渲染 虚拟DOM
ReactDOM.render(<MyComponent></MyComponent>, document.getElementById("app"));

(3)MyComponent.jsx:

import React from "react";

// 导入 日期选择组件
import { DatePicker } from "antd";

export default class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <div>
        <h3>在组件中引入 andt</h3>

        <DatePicker />
      </div>
    );
  }
}

代码运行效果:

20190217_1500.png

AntD组件

表格

pagination属性可以用来分页。

loading框

需求:在数据显示之前,展示 loading;在数据显示之后,关闭loading。

相关问题的链接

AntD pro,跳转到详情页,携带参数

AntD pro ,必填项前面,显示星号

其他问题

标签:基本,ant,Ant,design,import,MyComponent,Design
From: https://www.cnblogs.com/full-stack-linux-new/p/17366927.html

相关文章

  • c语言实现链表的基本操作——初始化,求长度,添加节点,遍历输出
    #include<stdio.h>#include<stdlib.h>//创建结构体并命名typedefstructNode //typedef用于对struct的重命名{ inti; structNode*next;}LNode,*LinkList; //定义一个结构体指针//链表初始化boolInistList(LinkListL){ L=(LNode*)malloc(sizeof(LNo......
  • linux的基础结构和常用的命令基本 Linux 命令的列表:
    linux的基础结构和常用的命令基本Linux命令的列表: Linux提供了大量的命令,利用它可以有效地完成大量的工作,如磁盘操作、文件存取、目录操作、进程管理、文件权限设定等。所以,在Linux系统上工作离不开使用系统提供的命令。要想真正理解Linux系统,就必须从Linux命令学起,通过基础......
  • SystemVerilog for Design Edition 2 Chapter 2
    SystemVerilogforDesignEdition2Chapter2SystemVerilogDeclarationSpacesVerilogonlyhaslimitedplacesinwhichdesignerscandeclarevariablesandotherdesigninformation.SystemVerilogextendsVerilog’sdeclarationspacesinseveralways.These......
  • SystemVerilog for Design Edition 2 Catalog
    SystemVerilogforDesignEdition2CatalogPart10:The2022WilsonResearchGroupFunctionalVerificationStudy-VerificationHorizons(siemens.com)SynthesizableSystemVerilog:BustingtheMyththatSystemVerilogisonlyforVerification(sutherland-......
  • SystemVerilog for Design Edition 2 Chapter 1
    SystemVerilogforDesignEdition2Chapter1IntroductiontoSystemVerilog:ThischapterprovidesanoverviewofSystemVerilog.Thetopicspresentedinthischapterinclude:•TheoriginsofSystemVerilog•TechnicaldonationsthatwentintoSystemVerilog......
  • 【愚公系列】用友系列之YonBuilder低代码平台概论和基本使用
    (文章目录)一、引言1.代码平台的概念和发展历程低代码平台是一种通过可视化界面和模板化组件快速创建应用程序的平台,其发展历程主要经历了三个阶段:第一个阶段是第一代低代码平台:其主要关注业务流程管理及应用程序的速度开发,但其可扩展性和可定制性较低。第二个阶段是第二代......
  • mongoDB基本使用
    一:简介MongoDB是一个非关系型数据库(NoSQL).非常适合超大数据集的存储,由C++语言编写,旨在为WEB应用提供可扩展的高性能数据存储解决方案。MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。二:MongoDB安装(w......
  • Spring MVC3 基本配置
    之前用过struts2,学习了springmvc之后,发现还是比struts2方便一些。首先,web.xml配置1.<</span>filter>2.<</span>filter-name>springUtf8Encoding</</span>filter-name>3.<</span>filter-class>org.springframework.we......
  • ActiveMQ学习(一)——MQ的基本概念…
    1)队列管理器队列管理器是MQ系统中最上层的一个概念,由它为我们提供基于队列的消息服务。2)消息在MQ中,我们把应用程序交由MQ传输的数据定义为消息,我们可以定义消息的内容并对消息进行广义的理解,比如:用户的各种类型的数据文件,某个应用向其它应用发出的处理请求等都可以作为消息。......
  • C/C++ 各类型int、long、double、char、long long取值范围(基本类型的最大最小值)
    做题的时候经常会使用到数据类型的最大最小值(如int,long,longlong,char等),我也查了很多次,这次就记下来当笔记吧。参考了C++primeplus、各个博客、教程和c++官网,对C/C++中各个类型int、long、double、char、longlong等基本类型的取值范围即最大最小值总结如下:1字节=8位,......