xxx
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
// import ReactDom from 'react-dom';
|
||||
import Slot from './components/slot/index'
|
||||
import './assets/css/public.css'
|
||||
import './assets/css/app.css'
|
||||
@@ -9,18 +8,24 @@ class App extends React.Component{
|
||||
this.state={
|
||||
}
|
||||
}
|
||||
del=function(){
|
||||
del=()=>function(){
|
||||
alert("删除")
|
||||
}
|
||||
render(){
|
||||
return (
|
||||
<div className="APP">
|
||||
<Slot type="button" className="hehe1" style={{fontSize:"20px", width:"100px"}}>保存</Slot>
|
||||
<Slot className="hehe1" style={{fontSize:"20px", width:"100px"}}><h1>保xxx存</h1></Slot>
|
||||
|
||||
<form action="http://www.baidu.com" target="_black">
|
||||
<input type="text"></input>
|
||||
<Slot type="submit" className="hehe2" style={{fontSize:"20px", width:"120px"}}>提交</Slot>
|
||||
</form>
|
||||
<Slot type="button" className="hehe3" style={{fontSize:"20px", width:"120px"}} haha={this.del.bind(this)}>删除</Slot>
|
||||
|
||||
<Slot type="button" className="hehe3"
|
||||
style={{fontSize:"20px", width:"120px"}}
|
||||
haha={this.del.bind(this)}
|
||||
>删除</Slot>
|
||||
|
||||
<Slot type="button" className="hehe4" style={{fontSize:"20px", width:"120px",marginLeft:"10px"}} >禁用</Slot>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -10,4 +10,9 @@
|
||||
}
|
||||
.slot-hehe4{
|
||||
color: #760aff;
|
||||
}
|
||||
form{
|
||||
margin: 20px 0;
|
||||
padding: 12px;
|
||||
border: 1px solid #666;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import React,{Component} from 'react'
|
||||
export default class InputComponent extends Component{
|
||||
render(){
|
||||
return(
|
||||
<div>
|
||||
<input type="text" onChange={this.props.hehe}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -15,3 +15,7 @@ export default class hehe extends Component{
|
||||
)
|
||||
}
|
||||
}
|
||||
// props设置默认值
|
||||
hehe.defaultProps={
|
||||
type:'buton'
|
||||
}
|
||||
Reference in New Issue
Block a user