diff --git a/高阶函数/轮播图/src/components/button/index.js b/高阶函数/轮播图/src/components/button/index.js deleted file mode 100755 index f6e21dc2a..000000000 --- a/高阶函数/轮播图/src/components/button/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import React,{Component} from 'react'; -import "./style.css"; -export default class InputComponent extends Component{ - render() { - return ( - - - - ); - } -} -InputComponent.defaultProps={ - type:"button" -}; diff --git a/高阶函数/轮播图/src/components/button/style.css b/高阶函数/轮播图/src/components/button/style.css deleted file mode 100755 index 68f68de91..000000000 --- a/高阶函数/轮播图/src/components/button/style.css +++ /dev/null @@ -1 +0,0 @@ -.my-button{width:auto;height:auto;background-color:#FF0000;font-size:14px;color:#FFFFFF;border:0 none;outline: none;border-radius: 3px;padding:5px 10px;cursor: pointer;} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/confirm/confirm.js b/高阶函数/轮播图/src/components/confirm/confirm.js deleted file mode 100755 index f98b5be3d..000000000 --- a/高阶函数/轮播图/src/components/confirm/confirm.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import "./style.css"; -export default class Confirm extends React.Component{ - constructor(){ - super(); - this.state={ - msg:"", - btns:[] - } - this.div=null; - } - setData(msg,btns,div){ - this.div=div; - this.setState({msg:msg,btns:btns}); - } - clickBtn(index){ - if(this.state.btns[index].onPress){ - this.state.btns[index].onPress(); - } - document.body.removeChild(this.div); - } - render(){ - return( -
-
-
{this.state.msg}
-
- { - this.state.btns.length>0 && this.state.btns.map((item,index)=>{ - return ( -
{item.text}
- ) - }) - } -
-
-
- ) - } -} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/confirm/index.js b/高阶函数/轮播图/src/components/confirm/index.js deleted file mode 100755 index a4cca6cd2..000000000 --- a/高阶函数/轮播图/src/components/confirm/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import ReactDom from 'react-dom'; -import Confirm from './confirm'; - -export default function(msg,btns){ - let div=document.createElement("div"); - document.body.appendChild(div); - let confirmInit=ReactDom.render(,div); - confirmInit.setData(msg,btns,div) -} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/confirm/style.css b/高阶函数/轮播图/src/components/confirm/style.css deleted file mode 100755 index 71f5141a5..000000000 --- a/高阶函数/轮播图/src/components/confirm/style.css +++ /dev/null @@ -1,5 +0,0 @@ -.my-confirm-mask{width:100%;height:100%;position:fixed;z-index:100;left:0px;top:0px;background-color: rgba(0,0,0,0.8) } -.my-confirm-mask .confirm{width:300px;height:150px;background-color:#FFFFFF;position: absolute;z-index:1;left:50%;top:50%;transform: translate(-50%,-50%);border-radius: 4px;} -.my-confirm-mask .message{width:auto;height:auto;text-align: center;font-size:16px;margin-top:40px;} -.my-confirm-mask .handle{width:100%;height:auto;display: flex;justify-content: space-between;padding:0px 30px;box-sizing: border-box;margin-top:40px;} -.my-confirm-mask .button{width:auto;height:auto;font-size:16px;cursor: pointer;} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/header/index.js b/高阶函数/轮播图/src/components/header/index.js deleted file mode 100755 index 5368bb721..000000000 --- a/高阶函数/轮播图/src/components/header/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import React,{Component} from 'react'; -//检查数据类型 -import PropTypes from 'prop-types'; -import "./style.module.css"; -class HeaderComponent extends Component{ - // changeTitle(){ - // this.props.title="首页2";//props是只读不可以改变 - // } - render() { - return ( - - ); - } -} -//检查属性值的类型 -HeaderComponent.propTypes={ - title:PropTypes.string.isRequired,//检查是否必填项 - isShow:PropTypes.bool -}; -//默认属性值 -HeaderComponent.defaultProps={ - title:"默认导航" -}; -export default HeaderComponent; diff --git a/高阶函数/轮播图/src/components/header/style.module.css b/高阶函数/轮播图/src/components/header/style.module.css deleted file mode 100755 index 5e94a35dd..000000000 --- a/高阶函数/轮播图/src/components/header/style.module.css +++ /dev/null @@ -1,2 +0,0 @@ -.app{width:100vw;height:40px;background-color:#FFFF00;} -.app.active{background-color:#00FFFF;} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/input/index.js b/高阶函数/轮播图/src/components/input/index.js deleted file mode 100755 index 235f4a70b..000000000 --- a/高阶函数/轮播图/src/components/input/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import React,{Component} from 'react'; -export default class InputComponent extends Component{ - render() { - return ( - - - - ); - } -} diff --git a/高阶函数/轮播图/src/components/toast/index.js b/高阶函数/轮播图/src/components/toast/index.js deleted file mode 100755 index 5d641a4ef..000000000 --- a/高阶函数/轮播图/src/components/toast/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import ReactDom from 'react-dom'; -import Toast from './toast'; - -export default function(opts){ - //创建div元素 - let div=document.createElement("div"),duration=opts.duration || 2000; - document.body.appendChild(div); -//将Toast和div挂载到render - let toastInit=ReactDom.render(,div); - toastInit.setOpts(opts); - setTimeout(()=>{ - div.querySelector(".my-toast").style.animation="hideToast 0.3s forwards"; - setTimeout(()=>{ - document.body.removeChild(div); - },3000) - if(opts.onClose){ - opts.onClose(); - } - },duration) -}; \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/toast/style.css b/高阶函数/轮播图/src/components/toast/style.css deleted file mode 100755 index 8d2aff216..000000000 --- a/高阶函数/轮播图/src/components/toast/style.css +++ /dev/null @@ -1,9 +0,0 @@ -.my-toast{width:auto;height:auto;background-color:rgba(0,0,0,0.8);position: fixed;z-index:100;left:50%;top:50%;transform: translate(-50%,-50%);font-size:16px;color:#FFFFFF;padding:10px;border-radius: 4px;animation: showToast 0.3s forwards} -@keyframes showToast { - 0%{opacity: 0} - 100%{opacity: 1} -} -@keyframes hideToast { - 0%{opacity: 1} - 100%{opacity: 0} -} \ No newline at end of file diff --git a/高阶函数/轮播图/src/components/toast/toast.js b/高阶函数/轮播图/src/components/toast/toast.js deleted file mode 100755 index da97cf3a1..000000000 --- a/高阶函数/轮播图/src/components/toast/toast.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import "./style.css"; -export default class Toast extends React.Component{ - constructor(){ - super(); - this.state={ - text:"" - } - } - setOpts(opts){ - this.setState({text:opts.txt}); - } - render(){ - return ( -
{this.state.text}
- ) - } -} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/button/index.js b/高阶函数/轮播图1/src/components/button/index.js deleted file mode 100644 index 428ff8772..000000000 --- a/高阶函数/轮播图1/src/components/button/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import React,{Component} from 'react'; -import "./style.css"; -export default class InputComponent extends Component{ - render() { - return ( - - - - ); - } -} -InputComponent.defaultProps={ - type:"button" -}; diff --git a/高阶函数/轮播图1/src/components/button/style.css b/高阶函数/轮播图1/src/components/button/style.css deleted file mode 100644 index 68f68de91..000000000 --- a/高阶函数/轮播图1/src/components/button/style.css +++ /dev/null @@ -1 +0,0 @@ -.my-button{width:auto;height:auto;background-color:#FF0000;font-size:14px;color:#FFFFFF;border:0 none;outline: none;border-radius: 3px;padding:5px 10px;cursor: pointer;} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/confirm/confirm.js b/高阶函数/轮播图1/src/components/confirm/confirm.js deleted file mode 100644 index 8f502cfbb..000000000 --- a/高阶函数/轮播图1/src/components/confirm/confirm.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import "./style.css"; -export default class Confirm extends React.Component{ - constructor(){ - super(); - this.state={ - msg:"", - btns:[] - } - this.div=null; - } - setData(msg,btns,div){ - this.div=div; - this.setState({msg:msg,btns:btns}); - } - clickBtn(index){ - if(this.state.btns[index].onPress){ - this.state.btns[index].onPress(); - } - document.body.removeChild(this.div); - } - render(){ - return( -
-
-
{this.state.msg}
-
- { - this.state.btns.length>0 && this.state.btns.map((item,index)=>{ - return ( -
{item.text}
- ) - }) - } -
-
-
- ) - } -} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/confirm/index.js b/高阶函数/轮播图1/src/components/confirm/index.js deleted file mode 100644 index 044cb9d30..000000000 --- a/高阶函数/轮播图1/src/components/confirm/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import ReactDom from 'react-dom'; -import Confirm from './confirm'; - -export default function(msg,btns){ - let div=document.createElement("div"); - document.body.appendChild(div); - let confirmInit=ReactDom.render(,div); - confirmInit.setData(msg,btns,div) -} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/confirm/style.css b/高阶函数/轮播图1/src/components/confirm/style.css deleted file mode 100644 index 850eef405..000000000 --- a/高阶函数/轮播图1/src/components/confirm/style.css +++ /dev/null @@ -1,5 +0,0 @@ -.my-confirm-mask{width:100%;height:100%;position:fixed;z-index:100;left:0px;top:0px;background-color: rgba(0,0,0,0.8) } -.my-confirm-mask .confirm{width:300px;height:150px;background-color:#FFFFFF;position: absolute;z-index:1;left:50%;top:50%;transform: translate(-50%,-50%);border-radius: 4px;} -.my-confirm-mask .message{width:auto;height:auto;text-align: center;font-size:16px;margin-top:40px;} -.my-confirm-mask .handle{width:100%;height:auto;display: flex;justify-content: space-between;padding:0px 30px;box-sizing: border-box;margin-top:40px;} -.my-confirm-mask .button{width:auto;height:auto;font-size:16px;cursor: pointer;} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/header/index.js b/高阶函数/轮播图1/src/components/header/index.js deleted file mode 100644 index ef6195ee6..000000000 --- a/高阶函数/轮播图1/src/components/header/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import React,{Component} from 'react'; -//检查数据类型 -import PropTypes from 'prop-types'; -import "./style.module.css"; -class HeaderComponent extends Component{ - // changeTitle(){ - // this.props.title="首页2";//props是只读不可以改变 - // } - render() { - return ( - - ); - } -} -//检查属性值的类型 -HeaderComponent.propTypes={ - title:PropTypes.string.isRequired,//检查是否必填项 - isShow:PropTypes.bool -}; -//默认属性值 -HeaderComponent.defaultProps={ - title:"默认导航" -}; -export default HeaderComponent; diff --git a/高阶函数/轮播图1/src/components/header/style.module.css b/高阶函数/轮播图1/src/components/header/style.module.css deleted file mode 100644 index 25874c796..000000000 --- a/高阶函数/轮播图1/src/components/header/style.module.css +++ /dev/null @@ -1,2 +0,0 @@ -.app{width:100vw;height:40px;background-color:#FFFF00;} -.app.active{background-color:#00FFFF;} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/input/index.js b/高阶函数/轮播图1/src/components/input/index.js deleted file mode 100644 index 0d5256b6f..000000000 --- a/高阶函数/轮播图1/src/components/input/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import React,{Component} from 'react'; -export default class InputComponent extends Component{ - render() { - return ( - - - - ); - } -} diff --git a/高阶函数/轮播图1/src/components/swiper/index.js b/高阶函数/轮播图1/src/components/swiper/index.js index 4a52f843e..f9d83ecec 100644 --- a/高阶函数/轮播图1/src/components/swiper/index.js +++ b/高阶函数/轮播图1/src/components/swiper/index.js @@ -1,32 +1,6 @@ import React from 'react'; import Hoc from './hoc'; import "./style.css"; -// export default Hoc((props)=>{ -// let aData=props.data; -// console.log(props) -// return( -//
-// { -// (aData && aData.length>0) && aData.map((item,index)=>{ -// return ( -//
-// -//
-// ) -// }) -// } -//
-// { -// (aData && aData.length>0) && aData.map((item,index)=>{ -// return ( -//
-// ) -// }) -// } -//
-//
-// ) -// }) class Usual extends React.Component { render() { diff --git a/高阶函数/轮播图1/src/components/toast/index.js b/高阶函数/轮播图1/src/components/toast/index.js deleted file mode 100644 index b7d05c42d..000000000 --- a/高阶函数/轮播图1/src/components/toast/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import ReactDom from 'react-dom'; -import Toast from './toast'; - -export default function(opts){ - //创建div元素 - let div=document.createElement("div"),duration=opts.duration || 2000; - document.body.appendChild(div); -//将Toast和div挂载到render - let toastInit=ReactDom.render(,div); - toastInit.setOpts(opts); - setTimeout(()=>{ - div.querySelector(".my-toast").style.animation="hideToast 0.3s forwards"; - setTimeout(()=>{ - document.body.removeChild(div); - },3000) - if(opts.onClose){ - opts.onClose(); - } - },duration) -}; \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/toast/style.css b/高阶函数/轮播图1/src/components/toast/style.css deleted file mode 100644 index c7dbc2dfd..000000000 --- a/高阶函数/轮播图1/src/components/toast/style.css +++ /dev/null @@ -1,9 +0,0 @@ -.my-toast{width:auto;height:auto;background-color:rgba(0,0,0,0.8);position: fixed;z-index:100;left:50%;top:50%;transform: translate(-50%,-50%);font-size:16px;color:#FFFFFF;padding:10px;border-radius: 4px;animation: showToast 0.3s forwards} -@keyframes showToast { - 0%{opacity: 0} - 100%{opacity: 1} -} -@keyframes hideToast { - 0%{opacity: 1} - 100%{opacity: 0} -} \ No newline at end of file diff --git a/高阶函数/轮播图1/src/components/toast/toast.js b/高阶函数/轮播图1/src/components/toast/toast.js deleted file mode 100644 index 29cb9a869..000000000 --- a/高阶函数/轮播图1/src/components/toast/toast.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import "./style.css"; -export default class Toast extends React.Component{ - constructor(){ - super(); - this.state={ - text:"" - } - } - setOpts(opts){ - this.setState({text:opts.txt}); - } - render(){ - return ( -
{this.state.text}
- ) - } -} \ No newline at end of file