assistant-note/src/components/CountUI/index.jsx

29 lines
843 B
JavaScript

import React, { Component } from 'react'
import { Button } from 'antd'
export default class index extends Component {
addRedux = () => {
const { value } = this.selectNumber
console.log(this.props)
this.props.jia(value * 1)
}
addReduxSync = () => {
const { value } = this.selectNumber
this.props.jian(value * 1,1000)
}
render() {
console.log(this.props)
return (
<div>
<h1>当前求和为: {this.props.count}</h1>
<select ref={c => this.selectNumber = c}>
<option>1</option>
<option>2</option>
</select>
<Button onClick={this.addRedux}>+</Button>
<Button onClick={this.addReduxSync}>+sync</Button>
</div>
)
}
}