ant.design初探
第一部分: 前言
推荐网站: https://ant.design/docs/spec/introduce-cn
ant.design是基于react开发的一个解放ui和前端的工具,它提供了一致的设计方便我们快速开发和减少不必要的设计与代码,很多实用react框架的开发者都已经在使用ant.design了,且其在github上的star数也早已上万,足见其火热程度。
ant.design的目的也在于提高用户、开发者等多方的体验与幸福感。
ant.design设计很精妙,vue的iview就是模仿ant.design来实现的。
既然要使用ant.design,我们不妨了解其设计原则是否是我们想要的,对于设计,我了解的最多的便是对比、对齐、亲密性、重复性,而ant.design也很好的实现了这些规则,并在此基础山践行了更多的想法。
- 直接了当 『需要在哪里输出,就要允许在哪里输入』。这就是直接操作的原理。eg:不要为了编辑内容而打开另一个页面,应该直接在上下文中实现编辑。
- 足不出户
- 简化交互 --- 如悬停时出现工具,qq在这里做的很好。
- 提供邀请
- 巧用过渡
https://ant.design/docs/spec/colors-cn
第二部分: 使用(引入css不好的方法)
ant.design 使用起来非常简单。
第一步:
- npm install antd --save
第二步(选择性的):
将node_modules下面的dist下面的 antd.min.css 取出放在静态文件中,在head中link引入。
第三步,开始使用:
在某个组件的上方:
- import {message} from 'antd'
然后在需要的时候使用: message.error('错误'); message.success('登录成功!'); 类似的使用即可。
如果我们仅仅是js,css完全自己写,那么上面的就足够了,但是,如果我们希望使用 ant.design 提供的css,那么我们就需要把css文件取出放在静态文件中,并在html的head中引用了。
注意: 在使用的时候引入的css中还使用了css初始化,如下所示:
- * antd v2.12.3
- *
- * Copyright -present, Alipay, Inc.
- * All rights reserved.
- */
- /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
- /* Document
- ========================================================================== */
- /**
- * 1. Correct the line height in all browsers.
- * 2. Prevent adjustments of font size after orientation changes in
- * IE on Windows Phone and in iOS.
- */
- html {
- line-height: 1.15;
- /* 1 */
- -ms-text-size-adjust: %;
- /* 2 */
- -webkit-text-size-adjust: %;
- /* 2 */
- }
- /* Sections
- ========================================================================== */
- /**
- * Remove the margin in all browsers (opinionated).
- */
- body {
- margin: ;
- }
- /**
- * Add the correct display in IE 9-.
- */
- article,
- aside,
- footer,
- header,
- nav,
- section {
- display: block;
- }
- /**
- * Correct the font size and margin on `h1` elements within `section` and
- * `article` contexts in Chrome, Firefox, and Safari.
- */
- h1 {
- font-size: 2em;
- margin: .67em ;
- }
- /* Grouping content
- ========================================================================== */
- /**
- * Add the correct display in IE 9-.
- * 1. Add the correct display in IE.
- */
- figcaption,
- figure,
- main {
- /* 1 */
- display: block;
- }
- /**
- * Add the correct margin in IE 8.
- */
- figure {
- margin: 1em 40px;
- }
- /**
- * 1. Add the correct box sizing in Firefox.
- * 2. Show the overflow in Edge and IE.
- */
- hr {
- box-sizing: content-box;
- /* 1 */
- height: ;
- /* 1 */
- overflow: visible;
- /* 2 */
- }
- /**
- * 1. Correct the inheritance and scaling of font size in all browsers.
- * 2. Correct the odd `em` font sizing in all browsers.
- */
- pre {
- font-family: monospace, monospace;
- /* 1 */
- /* stylelint-disable-line */
- font-size: 1em;
- /* 2 */
- }
- /* Text-level semantics
- ========================================================================== */
- /**
- * 1. Remove the gray background on active links in IE 10.
- * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
- */
- a {
- background-color: transparent;
- /* 1 */
- -webkit-text-decoration-skip: objects;
- /* 2 */
- }
- /**
- * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
- */
- abbr[title] {
- border-bottom: none;
- /* 1 */
- text-decoration: underline;
- /* 2 */
- text-decoration: underline dotted;
- /* 2 */
- }
- /**
- * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
- */
- b,
- strong {
- font-weight: inherit;
- }
- /**
- * Add the correct font weight in Chrome, Edge, and Safari.
- */
- b,
- strong {
- font-weight: bolder;
- }
- /**
- * 1. Correct the inheritance and scaling of font size in all browsers.
- * 2. Correct the odd `em` font sizing in all browsers.
- */
- code,
- kbd,
- samp {
- font-family: monospace, monospace;
- /* 1 */
- /* stylelint-disable-line */
- font-size: 1em;
- /* 2 */
- }
- /**
- * Add the correct font style in Android 4.3-.
- */
- dfn {
- font-style: italic;
- }
- /**
- * Add the correct background and color in IE 9-.
- */
- mark {
- background-color: #ff0;
- color: #;
- }
- /**
- * Add the correct font size in all browsers.
- */
- small {
- font-size: %;
- }
- /**
- * Prevent `sub` and `sup` elements from affecting the line height in
- * all browsers.
- */
- sub,
- sup {
- font-size: %;
- line-height: ;
- position: relative;
- vertical-align: baseline;
- }
- sub {
- bottom: -.25em;
- }
- sup {
- top: -.5em;
- }
- /* Embedded content
- ========================================================================== */
- /**
- * Add the correct display in IE 9-.
- */
- audio,
- video {
- display: inline-block;
- }
- /**
- * Add the correct display in iOS 4-7.
- */
- audio:not([controls]) {
- display: none;
- height: ;
- }
- /**
- * Remove the border on images inside links in IE 10-.
- */
- img {
- border-style: none;
- }
- /**
- * Hide the overflow in IE.
- */
- svg:not(:root) {
- overflow: hidden;
- }
- /* Forms
- ========================================================================== */
- /**
- * 1. Change the font styles in all browsers (opinionated).
- * 2. Remove the margin in Firefox and Safari.
- */
- button,
- input,
- optgroup,
- select,
- textarea {
- font-family: sans-serif;
- /* 1 */
- font-size: %;
- /* 1 */
- line-height: 1.15;
- /* 1 */
- margin: ;
- /* 2 */
- }
- /**
- * Show the overflow in IE.
- * 1. Show the overflow in Edge.
- */
- button,
- input {
- /* 1 */
- overflow: visible;
- }
- /**
- * Remove the inheritance of text transform in Edge, Firefox, and IE.
- * 1. Remove the inheritance of text transform in Firefox.
- */
- button,
- select {
- /* 1 */
- text-transform: none;
- }
- /**
- * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
- * controls in Android 4.
- * 2. Correct the inability to style clickable types in iOS and Safari.
- */
- button,
- html [type="button"],
- [type="reset"],
- [type="submit"] {
- -webkit-appearance: button;
- /* 2 */
- }
- /**
- * Remove the inner border and padding in Firefox.
- */
- button::-moz-focus-inner,
- [type="button"]::-moz-focus-inner,
- [type="reset"]::-moz-focus-inner,
- [type="submit"]::-moz-focus-inner {
- border-style: none;
- padding: ;
- }
- /**
- * Restore the focus styles unset by the previous rule.
- */
- button:-moz-focusring,
- [type="button"]:-moz-focusring,
- [type="reset"]:-moz-focusring,
- [type="submit"]:-moz-focusring {
- outline: 1px dotted ButtonText;
- }
- /**
- * Correct the padding in Firefox.
- */
- fieldset {
- padding: .35em .75em .625em;
- }
- /**
- * 1. Correct the text wrapping in Edge and IE.
- * 2. Correct the color inheritance from `fieldset` elements in IE.
- * 3. Remove the padding so developers are not caught out when they zero out
- * `fieldset` elements in all browsers.
- */
- legend {
- box-sizing: border-box;
- /* 1 */
- color: inherit;
- /* 2 */
- display: table;
- /* 1 */
- max-width: %;
- /* 1 */
- padding: ;
- /* 3 */
- white-space: normal;
- /* 1 */
- }
- /**
- * 1. Add the correct display in IE 9-.
- * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
- */
- progress {
- display: inline-block;
- /* 1 */
- vertical-align: baseline;
- /* 2 */
- }
- /**
- * Remove the default vertical scrollbar in IE.
- */
- textarea {
- overflow: auto;
- }
- /**
- * 1. Add the correct box sizing in IE 10-.
- * 2. Remove the padding in IE 10-.
- */
- [type="checkbox"],
- [type="radio"] {
- box-sizing: border-box;
- /* 1 */
- padding: ;
- /* 2 */
- }
- /**
- * Correct the cursor style of increment and decrement buttons in Chrome.
- */
- [type="number"]::-webkit-inner-spin-button,
- [type="number"]::-webkit-outer-spin-button {
- height: auto;
- }
- /**
- * 1. Correct the odd appearance in Chrome and Safari.
- * 2. Correct the outline style in Safari.
- */
- [type="search"] {
- -webkit-appearance: textfield;
- /* 1 */
- outline-offset: -2px;
- /* 2 */
- }
- /**
- * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
- */
- [type="search"]::-webkit-search-cancel-button,
- [type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
- }
- /**
- * 1. Correct the inability to style clickable types in iOS and Safari.
- * 2. Change font properties to `inherit` in Safari.
- */
- ::-webkit-file-upload-button {
- -webkit-appearance: button;
- /* 1 */
- font: inherit;
- /* 2 */
- }
- /* Interactive
- ========================================================================== */
- /*
- * Add the correct display in IE 9-.
- * 1. Add the correct display in Edge, IE, and Firefox.
- */
- details,
- menu {
- display: block;
- }
- /*
- * Add the correct display in all browsers.
- */
- summary {
- display: list-item;
- }
- /* Scripting
- ========================================================================== */
- /**
- * Add the correct display in IE 9-.
- */
- canvas {
- display: inline-block;
- }
- /**
- * Add the correct display in IE.
- */
- template {
- display: none;
- }
- /* Hidden
- ========================================================================== */
- /**
- * Add the correct display in IE 10-.
- */
- [hidden] {
- display: none;
- }
- @font-face {
- font-family: "Helvetica Neue For Number";
- src: local("Helvetica Neue");
- unicode-range: U+-;
- }
- * {
- box-sizing: border-box;
- -webkit-tap-highlight-color: rgba(, , , );
- }
- *:before,
- *:after {
- box-sizing: border-box;
- }
- html,
- body {
- width: %;
- height: %;
- }
- body {
- font-family: "Helvetica Neue For Number", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 12px;
- line-height: 1.5;
- color: rgba(, , , 0.65);
- background-color: #fff;
- }
- body,
- div,
- dl,
- dt,
- dd,
- ul,
- ol,
- li,
- h1,
- h2,
- h3,
- h4,
- h5,
- h6,
- pre,
- code,
- form,
- fieldset,
- legend,
- input,
- textarea,
- p,
- blockquote,
- th,
- td,
- hr,
- button,
- article,
- aside,
- details,
- figcaption,
- figure,
- footer,
- header,
- hgroup,
- menu,
- nav,
- section {
- margin: ;
- padding: ;
- }
- button,
- input,
- select,
- textarea {
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
- color: inherit;
- }
- ul,
- ol {
- list-style: none;
- }
- input::-ms-clear,
- input::-ms-reveal {
- display: none;
- }
- ::-moz-selection {
- background: #108ee9;
- color: #fff;
- }
- ::selection {
- background: #108ee9;
- color: #fff;
- }
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- color: rgba(, , , 0.85);
- font-weight: ;
- }
- a {
- color: #108ee9;
- background: transparent;
- text-decoration: none;
- outline: none;
- cursor: pointer;
- -webkit-transition: color .3s ease;
- transition: color .3s ease;
- }
- a:focus {
- text-decoration: underline;
- -webkit-text-decoration-skip: ink;
- text-decoration-skip: ink;
- }
- a:hover {
- color: #49a9ee;
- }
- a:active {
- color: #0e77ca;
- }
- a:active,
- a:hover {
- outline: ;
- text-decoration: none;
- }
- a[disabled] {
- color: rgba(, , , 0.25);
- cursor: not-allowed;
- pointer-events: none;
- }
其实,有些时候,使用 ant.design 没有办法满足我们的样式要求,所以,我们就需要使用 !important 来先找到样式然后强制来覆盖,但这绝对不是最佳实践。
下面我们介绍一种比较好用的方法。
第三部分: 使用(引入CSS较好的做法)、解析
之前我们引入css的方式是直接把整个css文件引入,这时一种不好的做法,因为在一个项目中也许我们仅仅是使用其中的几个组件,所以引入所有的css是完全没有必要的。
那么解决办法是什么呢?
拿 message 举例,我们可以在node_modules下的antd下的message中看到如下结构:
即,这里不仅仅有 index.js 和 index.d.ts 两者构成的js组件,还有一个 style 文件夹,这个文件夹中描述了对组件的样式。我们是可以直接从这里引入的。
比如,我们需要引入 message 的组件和相关的css,可以像下面这样:
- import { message } from 'antd';
- require('antd/lib/message/style')
当然也可以不用require, 用 import 也是可以的,如下所示:
- import { message } from 'antd';
- import 'antd/lib/message/style'
对于第一条语句,很容易理解,即引入了message的js组件。
对于第二条语句,由于 style 是一个文件夹,根据规则,是默认寻找其中的 index.js ,我们看看 index.js 中的内容是什么?
- 'use strict';
- require('../../style/index.less');
- require('./index.less');
其中的 ../../style/index.less 是ant.design的主题配置,比如,我们可以配置它的整体的颜色、文字大小等等。
另外,就是引入了这个style下面的 index.less, 比如message下的less是这样的:
- @import "../../style/themes/default";
- @message-prefix-cls: ~"@{ant-prefix}-message";
- .@{message-prefix-cls} {
- font-size: 16px;
- position: fixed;
- z-index: @zindex-message;
- width: %;
- top: 0px;
- left: ;
- pointer-events: none;
- &-notice {
- padding: 16px;
- padding-top: 16px;
- text-align: center;
- &:first-child {
- margin-top: -8px;
- }
- }
- &-notice-content {
- padding: 16px 32px;
- border-radius: @border-radius-base;
- box-shadow: @shadow-;
- background: @component-background;
- display: inline-block;
- pointer-events: all;
- }
- &-success .@{iconfont-css-prefix} {
- color: @success-color;
- }
- &-error .@{iconfont-css-prefix} {
- color: @error-color;
- }
- &-warning .@{iconfont-css-prefix} {
- color: @warning-color;
- }
- &-info .@{iconfont-css-prefix},
- &-loading .@{iconfont-css-prefix} {
- color: @info-color;
- }
- .@{iconfont-css-prefix} {
- margin-right: 8px;
- font-size: @font-size-lg;
- top: 1px;
- position: relative;
- }
- &-notice.move-up-leave.move-up-leave-active {
- animation-name: MessageMoveOut;
- overflow: hidden;
- animation-duration: .3s;
- }
- }
- @keyframes MessageMoveOut {
- % {
- opacity: ;
- max-height: 150px;
- padding: 8px;
- }
- % {
- opacity: ;
- max-height: ;
- padding: ;
- }
- }
我们如果觉得样式不合适,只需要在这个less文件中直接修改就可以了。这样就会经过编译在页面上显示出效果。
那么其中的js文件又代表什么呢? 即一个是 index.js, 另外一个是 index.d.js,这两个文件就描述了这个 message 组件。 我们首先来看看 index.js 内容吧,直接在代码中注释解释:'use strict';// 这句声明表示这个文件是一个可以被引入的模块。
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- // 引入react
- var _react = require('react');
- var _react2 = _interopRequireDefault(_react);
// 引入 rcNotification- var _rcNotification = require('rc-notification');
- var _rcNotification2 = _interopRequireDefault(_rcNotification);
// 引入 icon 组件,即通知正确、错误时的图标icon- var _icon = require('../icon');
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
// 通知的toast默认时间设置为3s- var defaultDuration = 3;
- // 这里的void后面可以是一个表达式,但是这个表达式的返回结果永远是undefined。
- var defaultTop = void ;
- var messageInstance = void ;
- var key = ;
- // 这里应该是组件的前缀
- var prefixCls = 'ant-message';
- var getContainer = void ;
- // 获取一个 message 实例
- function getMessageInstance() {
- messageInstance = messageInstance || _rcNotification2['default'].newInstance({
- prefixCls: prefixCls,
- transitionName: 'move-up',
- style: { top: defaultTop },
- getContainer: getContainer
- });
- return messageInstance;
- }
- function notice(content) {
- var duration = arguments.length > && arguments[] !== undefined ? arguments[] : defaultDuration;
- var type = arguments[];
- var onClose = arguments[];
// 定义icon的样式- var iconType = {
- info: 'info-circle',
- success: 'check-circle',
- error: 'cross-circle',
- warning: 'exclamation-circle',
- loading: 'loading'
- }[type];
// 在notice(通知)的时候创建一个实例
var instance = getMessageInstance();- instance.notice({
- key: key,
- duration: duration,
- style: {},
- content: _react2['default'].createElement(
- 'div',
- { className: prefixCls + '-custom-content ' + prefixCls + '-' + type },
- _react2['default'].createElement(_icon2['default'], { type: iconType }),
- _react2['default'].createElement(
- 'span',
- null,
- content
- )
- ),
- onClose: onClose
- });
- return function () {
- var target = key++;
- return function () {
- instance.removeNotice(target);
- };
- }();
- }
- // 关键: 暴露出去的方法,就是我们在组件中引入message时可以直接调用的方法。
- exports['default'] = {
- info: function info(content, duration, onClose) {
- return notice(content, duration, 'info', onClose);
- },
- success: function success(content, duration, onClose) {
- return notice(content, duration, 'success', onClose);
- },
- error: function error(content, duration, onClose) {
- return notice(content, duration, 'error', onClose);
- },
- // Departed usage, please use warning()
- warn: function warn(content, duration, onClose) {
- return notice(content, duration, 'warning', onClose);
- },
- warning: function warning(content, duration, onClose) {
- return notice(content, duration, 'warning', onClose);
- },
- loading: function loading(content, duration, onClose) {
- return notice(content, duration, 'loading', onClose);
- },
- config: function config(options) {
- if (options.top !== undefined) {
- defaultTop = options.top;
- messageInstance = null; // delete messageInstance for new defaultTop
- }
- if (options.duration !== undefined) {
- = options.duration;
- }
- if (options.prefixCls !== undefined) {
- prefixCls = options.prefixCls;
- }
- if (options.getContainer !== undefined) {
- getContainer = options.getContainer;
- }
- },
- destroy: function destroy() {
- if (messageInstance) {
- messageInstance.destroy();
- messageInstance = null;
- }
- }
- };
- module.exports = exports['default'];
可以看到,这些方法,如 message.info() 、message.warning()都可以接收三个参数
- 希望通知的信息
- 这个通知信息所持续的时间
- 当通知结束之后的回调函数
ok!下面我们来看看 index.d.ts 文件:
- /// <reference types="react" />
- import React from 'react';
- export declare type ConfigOnClose = () => void;
- export interface ConfigOptions {
- top?: number;
- duration?: number;
- prefixCls?: string;
- getContainer?: () => HTMLElement;
- }
- declare const _default: {
- info(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- success(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- error(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- warn(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- warning(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- loading(content: React.ReactNode, duration?: number | undefined, onClose?: ConfigOnClose | undefined): () => void;
- config(options: ConfigOptions): void;
- destroy(): void;
- };
- export default _default;
哈哈 ,看不懂,等看完了ts回来讲解。
第四部分: ant.design的栅格系统
在 ant.design 中,对于栅格系统的设计和bootstrap中的设计是极其类似的,核心概念为: Row一定是最外层的, Col一定是分布在Row中的, 内容一定是在Col里的, 当然,在Col中我们还可以嵌套Row,在antd中, Col被分成了24分(与bootstrap的12份是类似的)。
在Col中,我们可以使用span={number}来制定一个Col的宽度,具体的做法是使用 百分比 来划分, 如 span={4} 的占满,那么每一份就是 16.6667% , 如果 span={12} 占满,那么每一份就是 50%。。。。 依次类推。
另外,在Col中我们还可以使用offset来进行便宜,正值为向右偏移,使用的原理是 margin-left 或者是 margin-right。
我们还可以在Row中设置 gutter={number } 这个值就是栅格的间距,具体实现原理就是对div根据百分比来划分,然后在div内容使用padding,这时content肯定是减小的。
除此之外,还可以在 Col 中设置 push={number} 以及 pull={number},实现原理也非常简单,就是使用元素的 position: relative;值,通过 left=百分比;以及right=百分比; 这样就可以实现pull 和 push 就可以了。
当然,我们还可以使用 Row 的flex进行布局,这种布局方式只需要在 Row 上设置 type="flex",就可以设置竖直和水平对齐方式了。
竖直对齐方式:
- align="top" 向上对齐
- align="middle" 中间对齐
- alegn="bottom" 向下对齐
水平对其方式:
- justify="start" 左对齐
- justify='end' 右对齐
- justify="center" 中间对齐
- justify='space-between' 中间
- jusify="space-around" 中间
这些flex布局的原理也很简单,就是直接使用css3的flex, 如align-items以及 justify-content。
另外, ant.design也是支持响应式布局的 。 和bootstrap一样。
注意点:
- 一般在我们制作表格的时候,可以使用 ant.design 的栅格系统,比如,左边是说明性文字,右边是选择项或者是input框。 整体使用flex布局即可。 左边的给一个固定的宽度,如span={4},右边的就是span={24}了, 并且在右边,如果是input框就比较好解决,如果是几个框,我们需要分开排列,就需要使用一个 <Row>,然后设置flex,其中justify应该是space-between,而能是start、end、center或者是 space-around。 因为对于 start、end、center,会使得几个框都会贴的很紧(除非是我们在其中再添加一个div,然后添加一个padding,这样才能做到分割),那么space-between和space-around的区别是什么?前者是两边贴近然后中间有空位置,而后者是两边的距离为中间padding的一般。
- 另外,我们也是可以用gutter的,但是最好不用,因为,gutter在两边也会有间距,这样对于对齐的控制非常麻烦。
ant.design初探的更多相关文章
- 初探ant design pro
1.增加路由子页面&配置菜单 因为ant design pro采取的是umi路由配置,所以只要在对应的文件夹下新建相关的文件夹以及文件,它会自动解析.按照如下的步骤做即可 PS.如果想要给菜单 ...
- Ant Design 的一个练习小Demo
Ant Design 由蚂蚁金服团队出品, 基于 React 的组件化开发模式,封装了一套丰富而实用的 UI 组件库. 在这个练习Demo 中,按照 Ant Design 官网的教程示例,尝试使用 A ...
- 实现Ant Design 自定义表单组件
Ant Design 组件提供了Input,InputNumber,Radio,Select,uplod等表单组件,但实际开发中这是不能满足需求,同时我们希望可以继续使用Form提供的验证和提示等方法 ...
- Ant Design UI组件
Ant Design 是面向中台的 UI 设计语言. http://ant.design/
- Ant Design Pro+Electron+electron-builder实现React应用脱离浏览器,桌面安装运行
ant-design-pro ----> version :2.3.1 由于网上Ant Design Pro+Electron的资料太少,我就贡献一点经验 最近需要讲AntD Pro项目(以 ...
- button样式篇一(ant Design React)
这篇来介绍button中elementUi.iview.ant中样式结构 ant Design react ant-react中button分两个文件less: mixins.less:根据butto ...
- elementUi、iview、ant Design源码button结构篇
在看elementUI的button组件的时候,一起和iview.ant Design的button组件比 较功能.样式.代码结构,看他们的一些不同点,不同的写法哪种会好些,button的对外开放的功 ...
- 使用selenium操作ant design前端的页面,感觉页面没加载完
因需要收集页面数据,遂准备使用selenium爬取瓦斯阅读页面, 瓦斯网站使用的是ant design,元素定位非常困难,页面元素都没有ID,现在还只是能做到操作登录,不能自动打开订阅,查询某公众号, ...
- 使用Ant Design的select组件时placeholder不生效/不起作用的解决办法
先来说说使用Ant Design和Element-ui的感觉吧. 公司的项目开发中用的是vue+element-ui,使用了一通下来后,觉得element-ui虽然也有一些问题或坑,但这些小问题或坑凭 ...
随机推荐
- 使用 console.time() 计算js代码执行时间
console.time('hellor'); for(var i=0;i<100000;i++){} console.timeEnd('hellor');
- linux 管道与重定向
命令行shell数据流有如下定义: 通过管道和重定向可以控制CLI的数据流
- JAVA IO总结及socket简单实现
为了方便理解与阐述,先引入两张图: a.Java IO中常用的类 在整个Java.io包中最重要的就是5个类和一个接口.5个类指的是File.OutputStream.InputStream.Writ ...
- ASP.NET程序从IIS6移植到IIS7时出现500.22错误(转)
最可能的原因: • 此应用程序在 system.web/httpModules 节中定义配置. 可尝试的操作: • 将配置迁移到 system.webServer/modules 节.也可 ...
- 创建oracle数据库时,出现ORA-00922: 选项缺失或无效
sdd53HOME 新建oracle数据库时遇到ORA-00922: 选项缺失或无效的问题,如图: 原因:一般是语句的语法有问题.比如命名不对,关键字写错等等.对于非标准的命名,一般采用双引号来创建. ...
- 201621123023《Java程序设计》第2周学习总结
一. 本周学习总结 引用类型变量存放指向对象的引用(类似于地址): == 与 equals 区别在于:==比较的是引用是否相等, 而equals则比较指向对象的内容是否相等: 因为String的不可变 ...
- “全栈2019”Java第二十二章:控制流程语句中的决策语句if-else
难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...
- bzoj1800飞行棋
题目链接 简单模拟 真的不敢相信ahoi09年的题竟然是这个难度 首先,一个必须要知道的定理是:圆上只有直径所对的圆周角是直角. 然后就很显然了, 只有两条不重合的直径上的四个点才能组成一个矩形, 所 ...
- [转贴]VC编译器版本号_MSC_VER and _MSC_FULL_VER
Visual Studio version and discrimination macros Abbreviation Product name [Visual Studio version] †1 ...
- ubuntu下搭建Discuz
环境:我用桥接方式创建了一个ubuntu16的虚拟机,ip为192.168.0.220 1.安装mysql sudo apt-get install mysql-server mysql-cl ...