fix(Search): inherit style/class

This commit is contained in:
chenjiahan 2020-08-17 20:17:50 +08:00
parent 47cb515979
commit 742872a4aa

View File

@ -74,6 +74,8 @@ export default createComponent({
const fieldData = { const fieldData = {
...this.$attrs, ...this.$attrs,
style: null,
class: null,
onKeypress(event) { onKeypress(event) {
// press enter // press enter
if (event.keyCode === 13) { if (event.keyCode === 13) {
@ -86,8 +88,8 @@ export default createComponent({
return ( return (
<div <div
class={bem({ 'show-action': props.showAction })} class={[bem({ 'show-action': props.showAction }), this.$attrs.class]}
style={{ background: props.background }} style={{ background: props.background, ...this.$attrs.style }}
> >
{slots.left?.()} {slots.left?.()}
<div class={bem('content', props.shape)}> <div class={bem('content', props.shape)}>