fix: input-search support addonAfter and addonBefore slot #581

pull/601/head
tangjinzhou 2019-03-15 22:56:05 +08:00
parent fc72620bea
commit 72202591a5
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,8 @@ export default {
const { prefixCls, inputPrefixCls, size, ...others } = getOptionProps(this); const { prefixCls, inputPrefixCls, size, ...others } = getOptionProps(this);
const suffix = getComponentFromProp(this, 'suffix'); const suffix = getComponentFromProp(this, 'suffix');
const enterButton = getComponentFromProp(this, 'enterButton'); const enterButton = getComponentFromProp(this, 'enterButton');
const addonAfter = getComponentFromProp(this, 'addonAfter');
const addonBefore = getComponentFromProp(this, 'addonBefore');
const buttonOrIcon = this.getButtonOrIcon(); const buttonOrIcon = this.getButtonOrIcon();
let searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon; let searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon;
if (Array.isArray(searchSuffix)) { if (Array.isArray(searchSuffix)) {
@ -99,6 +101,8 @@ export default {
prefixCls: inputPrefixCls, prefixCls: inputPrefixCls,
size, size,
suffix: searchSuffix, suffix: searchSuffix,
addonAfter,
addonBefore,
}, },
attrs: this.$attrs, attrs: this.$attrs,
on: { on: {