mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 06:31:45 +08:00
perf(Popover): using popper lite
This commit is contained in:
parent
7b51efa572
commit
ae29b09520
@ -1,4 +1,5 @@
|
|||||||
import { createPopper } from '@popperjs/core';
|
import { createPopper } from '@popperjs/core/lib/popper-lite';
|
||||||
|
import offsetModifier from '@popperjs/core/lib/modifiers/offset';
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
import { BORDER_BOTTOM } from '../utils/constant';
|
import { BORDER_BOTTOM } from '../utils/constant';
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'offset',
|
...offsetModifier,
|
||||||
options: {
|
options: {
|
||||||
offset: this.offset,
|
offset: this.offset,
|
||||||
},
|
},
|
||||||
@ -110,12 +111,14 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
renderAction(action) {
|
renderAction(action) {
|
||||||
|
const { icon, text, disabled, className } = action;
|
||||||
return (
|
return (
|
||||||
<div class={bem('action')} onClick={this.onClickAction}>
|
<div
|
||||||
{action.icon && (
|
class={[bem('action', { disabled }), className]}
|
||||||
<Icon name={action.icon} class={bem('action-icon')} />
|
onClick={this.onClickAction}
|
||||||
)}
|
>
|
||||||
<div class={[bem('action-text'), BORDER_BOTTOM]}>{action.text}</div>
|
{icon && <Icon name={icon} class={bem('action-icon')} />}
|
||||||
|
<div class={[bem('action-text'), BORDER_BOTTOM]}>{text}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user