fix(components): [popper] prioritise user's popper-style (#12833)

* fix(components): [popper] prioritise users popper-style

fix: #12831

* test: fix packages/popper testcase
This commit is contained in:
仿生狮子
2023-05-21 20:46:24 +08:00
committed by GitHub
parent 9241b4dbe4
commit f986b63a00
2 changed files with 4 additions and 4 deletions

View File

@@ -75,14 +75,14 @@ describe('<ElPopperContent />', () => {
expect(wrapper.classes()).toEqual(['el-popper', 'is-dark'])
expect(wrapper.vm.contentStyle).toHaveLength(3)
expect(wrapper.vm.contentStyle[0]).toHaveProperty('zIndex')
expect(wrapper.vm.contentStyle[1]).toEqual({})
expect(wrapper.vm.contentStyle[2]).toEqual(
expect(wrapper.vm.contentStyle[1]).toEqual(
expect.objectContaining({
position: 'absolute',
top: '0',
left: '0',
})
)
expect(wrapper.vm.contentStyle[2]).toEqual({})
})
it('should be able to be pure and themed', async () => {
@@ -108,7 +108,7 @@ describe('<ElPopperContent />', () => {
popperStyle: style,
})
expect(wrapper.vm.contentStyle[1]).toEqual(style)
expect(wrapper.vm.contentStyle[2]).toEqual(style)
})
it('should be able to emit events', async () => {

View File

@@ -29,8 +29,8 @@ export const usePopperContentDOM = (
const contentStyle = computed<StyleValue[]>(() => {
return [
{ zIndex: unref(contentZIndex) } as CSSProperties,
props.popperStyle || {},
unref(styles).popper as CSSProperties,
props.popperStyle || {},
]
})
const ariaModal = computed<string | undefined>(() =>