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)
|
await trigger.trigger(CLICK_EVENT)
|
||||||
expect(popper.vm.visibility).toBe(false)
|
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,
|
$slots,
|
||||||
appendToBody,
|
appendToBody,
|
||||||
class: kls,
|
class: kls,
|
||||||
|
style,
|
||||||
effect,
|
effect,
|
||||||
hide,
|
hide,
|
||||||
onPopperMouseEnter,
|
onPopperMouseEnter,
|
||||||
@ -103,6 +104,7 @@ export default defineComponent({
|
|||||||
const triggerProps = {
|
const triggerProps = {
|
||||||
ariaDescribedby: popperId,
|
ariaDescribedby: popperId,
|
||||||
class: kls,
|
class: kls,
|
||||||
|
style,
|
||||||
ref: 'triggerRef',
|
ref: 'triggerRef',
|
||||||
...this.events,
|
...this.events,
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
style: Object,
|
||||||
closeDelay: {
|
closeDelay: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 200,
|
default: 200,
|
||||||
|
Loading…
Reference in New Issue
Block a user