bee-input-group-addon
Advanced tools
Comparing version
@@ -1,3 +0,15 @@ | ||
import Demo from './InputGroupAddonDemo'; | ||
import InputGroupAddon from '../src'; | ||
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
ReactDOM.render(<Demo/>, document.getElementById('tinperBeeDemo')); | ||
function demo1() { | ||
return ( | ||
<div className="demo-input-group-addon"> | ||
<InputGroupAddon>I am InputGroupAddon</InputGroupAddon> | ||
</div> | ||
); | ||
} | ||
ReactDOM.render(demo1(), document.getElementById('ReactInputGroupAddonDemo1')); |
@@ -8,4 +8,3 @@ import InputGroupAddon from '../src'; | ||
<div> | ||
<InputGroupAddon/> | ||
<InputGroupAddon/> | ||
<InputGroupAddon>I am InputGroupAddon</InputGroupAddon> | ||
</div> | ||
@@ -12,0 +11,0 @@ ) |
{ | ||
"name": "bee-input-group-addon", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "input-group-addon ui component for react", | ||
@@ -32,3 +32,4 @@ "keywords": [ | ||
"browsers": "bee-tools run browsers", | ||
"pub": "bee-tools run pub" | ||
"pub": "bee-tools run pub", | ||
"coveralls": "bee-tools run coverage" | ||
}, | ||
@@ -43,3 +44,3 @@ "dependencies": { | ||
"react": "~0.14.0", | ||
"react-addons-test-utils": "^15.3.2", | ||
"react-addons-test-utils": "15.3.2", | ||
"react-dom": "~0.14.0", | ||
@@ -46,0 +47,0 @@ "console-polyfill": "~0.2.1", |
# bee-input-group-addon | ||
[](https://www.npmjs.com/package/bee-input-group-addon) | ||
[](https://travis-ci.org/tinper-bee/bee-input-group-addon) | ||
[](https://david-dm.org/tinper-bee/bee-input-group-addon#info=devDependencies) | ||
[](https://travis-ci.org/tinper-bee/bee-input-group-addon) | ||
[](https://coveralls.io/github/tinper-bee/bee-input-group-addon?branch=master) | ||
InputGroupAddon 作为FormControl的边标签容器存在 | ||
InputGroupAddon 作为FormControl的边标签容器存在,修饰补充FormControl.比如文字说明,货币说明。 | ||
@@ -8,0 +8,0 @@ |
import classNames from 'classnames'; | ||
import React from 'react'; | ||
const defaultProps = { | ||
clsPrefix: 'u-input-group-addon' | ||
} | ||
class InputGroupAddon extends React.Component { | ||
render() { | ||
const { className, ...others } = this.props; | ||
const { className,clsPrefix, ...others } = this.props; | ||
let classes = { | ||
'input-group-addon' : true | ||
} | ||
return ( | ||
<span | ||
{...others} | ||
className={classNames(className, classes)} | ||
className={classNames(className, clsPrefix)} | ||
/> | ||
@@ -20,3 +20,3 @@ ); | ||
} | ||
InputGroupAddon.defaultProps = defaultProps; | ||
export default InputGroupAddon; |
@@ -10,4 +10,4 @@ import React from 'react'; | ||
let inputGroupAddon = shallow(<InputGroupAddon/>); | ||
expect(inputGroupAddon.length).to.equal(1); | ||
expect(inputGroupAddon.hasClass('u-input-group-addon')).to.equal(true); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9550
7.57%16
6.67%96
10.34%