mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
fix(popper): attr style fallthrough failed (#897)
This commit is contained in:
parent
158c4f9766
commit
fabb9d5f03
@ -407,5 +407,19 @@ describe('Popper.vue', () => {
|
||||
await trigger.trigger(CLICK_EVENT)
|
||||
expect(popper.vm.visibility).toBe(false)
|
||||
})
|
||||
|
||||
test('should pass style and class to trigger', async () => {
|
||||
const CLASS = 'fake'
|
||||
const STYLE = 'width: 100px'
|
||||
const wrapper = _mount({
|
||||
appendToBody: false,
|
||||
class: CLASS,
|
||||
style: STYLE,
|
||||
})
|
||||
|
||||
const trigger = wrapper.find(`.${TEST_TRIGGER}`)
|
||||
expect(trigger.classes(CLASS)).toBe(true)
|
||||
expect((trigger.element as HTMLDivElement).style.width).toBe('100px')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -53,6 +53,7 @@ export default defineComponent({
|
||||
$slots,
|
||||
appendToBody,
|
||||
class: kls,
|
||||
style,
|
||||
effect,
|
||||
hide,
|
||||
onPopperMouseEnter,
|
||||
@ -103,6 +104,7 @@ export default defineComponent({
|
||||
const triggerProps = {
|
||||
ariaDescribedby: popperId,
|
||||
class: kls,
|
||||
style,
|
||||
ref: 'triggerRef',
|
||||
...this.events,
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ export default {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
style: Object,
|
||||
closeDelay: {
|
||||
type: Number,
|
||||
default: 200,
|
||||
|
Loading…
Reference in New Issue
Block a user