Skip to content

Commit

Permalink
fix: 修复 Proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Sep 3, 2018
1 parent 8caef7d commit 1ac4bdf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 44 deletions.
36 changes: 18 additions & 18 deletions components/modal/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent, Fragment } from "react";
import propTypes from "prop-types";
import PropTypes from "prop-types";
import { createPortal, render } from "react-dom"; //传送门 将节点挂载在root 节点之外
import cls from "classnames";
import Button from "../button";
Expand All @@ -26,24 +26,24 @@ export default class Modal extends PureComponent {
closable: true,
showMask: true
};
static propTypes = {
onCancel: propTypes.func,
onOk: propTypes.func,
title: propTypes.oneOfType([propTypes.string, propTypes.object]),
okText: propTypes.oneOfType([propTypes.string, propTypes.object]),
cancelText: propTypes.oneOfType([propTypes.string, propTypes.object]),
content: propTypes.oneOfType([propTypes.string, propTypes.object]),
confirmLoading: propTypes.bool,
visible: propTypes.bool,
centered: propTypes.bool,
closable: propTypes.bool,
maskClosable: propTypes.bool,
showMask: propTypes.bool,
footer: propTypes.oneOfType([
static PropTypes = {
onCancel: PropTypes.func,
onOk: PropTypes.func,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
okText: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
cancelText: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
content: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
confirmLoading: PropTypes.bool,
visible: PropTypes.bool,
centered: PropTypes.bool,
closable: PropTypes.bool,
maskClosable: PropTypes.bool,
showMask: PropTypes.bool,
footer: PropTypes.oneOfType([
//footer 不需要设置为 footer={null}
propTypes.array,
propTypes.bool,
propTypes.object
PropTypes.array,
PropTypes.bool,
PropTypes.object
])
};
constructor(props) {
Expand Down
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cuke-ui",
"version": "0.0.3",
"version": "0.0.4",
"main": "lib/index.js",
"description": "A React.js UI components for Web",
"repository": "https://github.com/cuke-ui/cuke-ui.git",
Expand Down Expand Up @@ -50,6 +50,10 @@
"gitEmail": "1359518268@qq.com",
"commitMessage": "docs: deploy docs"
},
"peerDependencies": {
"react": ">=16.0.0",
"react-dom": ">=16.0.0"
},
"keywords": [
"cuke",
"cuke-ui",
Expand All @@ -61,6 +65,14 @@
"ui",
"web"
],
"tags": [
"cuke",
"cuke-ui",
"react",
"react-ui",
"component",
"lijinke666"
],
"devDependencies": {
"@storybook/addon-console": "^1.0.4",
"@storybook/addon-info": "^3.4.10",
Expand Down Expand Up @@ -125,6 +137,7 @@
"progress-bar-webpack-plugin": "^1.11.0",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-icons": "^3.0.5",
"react-loader": "^2.4.0",
"rimraf": "^2.6.0",
"sinon": "^5.0.7",
Expand All @@ -137,7 +150,8 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
"react-icons": "^3.0.5",
"classnames": "^2.2.6",
"prop-types": "^15.6.2",
"react-jinke-music-player": "^4.0.4",
"react-turntable": "^1.2.5"
}
Expand Down
27 changes: 3 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7199,12 +7199,6 @@ md5.js@^1.3.4:
hash-base "^3.0.0"
inherits "^2.0.1"

mdast-add-list-metadata@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdast-add-list-metadata/-/mdast-add-list-metadata-1.0.1.tgz#95e73640ce2fc1fa2dcb7ec443d09e2bfe7db4cf"
dependencies:
unist-util-visit-parents "1.1.2"

mdast-util-compact@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.2.tgz#c12ebe16fffc84573d3e19767726de226e95f649"
Expand Down Expand Up @@ -9360,7 +9354,7 @@ react-icons@^2.2.5, react-icons@^2.2.7:

react-icons@^3.0.5:
version "3.0.5"
resolved "http://registry.npm.taobao.org/react-icons/download/react-icons-3.0.5.tgz#9f22a319a48b562e052af2255a3dda8ded363d1c"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-3.0.5.tgz#9f22a319a48b562e052af2255a3dda8ded363d1c"

react-inspector@^2.2.2:
version "2.3.0"
Expand Down Expand Up @@ -9398,17 +9392,6 @@ react-loader@^2.4.0:
prop-types "^15.5.8"
spin.js "2.x"

react-markdown@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-3.5.0.tgz#dd571829139597efafb58a039ded551cd8e132d1"
dependencies:
mdast-add-list-metadata "1.0.1"
prop-types "^15.6.1"
remark-parse "^5.0.0"
unified "^6.1.5"
unist-util-visit "^1.3.0"
xtend "^4.0.1"

react-modal@^3.3.2:
version "3.5.1"
resolved "http://registry.npm.taobao.org/react-modal/download/react-modal-3.5.1.tgz#33d38527def90ea324848f7d63e53acc4468a451"
Expand Down Expand Up @@ -11168,7 +11151,7 @@ unherit@^1.0.4:
inherits "^2.0.1"
xtend "^4.0.1"

unified@^6.0.0, unified@^6.1.5:
unified@^6.0.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba"
dependencies:
Expand Down Expand Up @@ -11232,17 +11215,13 @@ unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6"

unist-util-visit-parents@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06"

unist-util-visit-parents@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz#63fffc8929027bee04bfef7d2cce474f71cb6217"
dependencies:
unist-util-is "^2.1.2"

unist-util-visit@^1.1.0, unist-util-visit@^1.3.0:
unist-util-visit@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.0.tgz#1cb763647186dc26f5e1df5db6bd1e48b3cc2fb1"
dependencies:
Expand Down

0 comments on commit 1ac4bdf

Please sign in to comment.