2018-03-20 11:06:04 +00:00
|
|
|
import { filterEmpty } from '../_util/props-util'
|
2017-12-06 10:54:20 +00:00
|
|
|
export default {
|
2018-04-08 13:17:20 +00:00
|
|
|
name: 'AInputGroup',
|
2017-12-06 10:54:20 +00:00
|
|
|
props: {
|
|
|
|
prefixCls: {
|
|
|
|
default: 'ant-input-group',
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
size: {
|
|
|
|
validator (value) {
|
|
|
|
return ['small', 'large', 'default'].includes(value)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
compact: Boolean,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
classes () {
|
|
|
|
const { prefixCls, size, compact = false } = this
|
|
|
|
return {
|
|
|
|
[`${prefixCls}`]: true,
|
|
|
|
[`${prefixCls}-lg`]: size === 'large',
|
|
|
|
[`${prefixCls}-sm`]: size === 'small',
|
|
|
|
[`${prefixCls}-compact`]: compact,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
},
|
2018-03-19 01:43:31 +00:00
|
|
|
render () {
|
2018-09-05 13:28:54 +00:00
|
|
|
const { $listeners } = this
|
2018-03-19 01:43:31 +00:00
|
|
|
return (
|
2018-09-05 13:28:54 +00:00
|
|
|
<span class={this.classes} {...{ on: $listeners }} >
|
2018-03-20 11:06:04 +00:00
|
|
|
{filterEmpty(this.$slots.default)}
|
2018-03-19 01:43:31 +00:00
|
|
|
</span>
|
|
|
|
)
|
|
|
|
},
|
2017-12-06 10:54:20 +00:00
|
|
|
}
|
2018-03-19 02:16:27 +00:00
|
|
|
|