chore(components): add shadow to panels (#5146)

* chore(components): add shadow to panels

* fix: improve menu test
This commit is contained in:
msidolphin 2022-01-08 19:52:50 +08:00 committed by GitHub
parent 0508c6fadd
commit d61cf39cf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View File

@ -392,8 +392,9 @@ describe('other', () => {
expect(submenu1.classes().includes('is-opened')).toBeFalsy()
})
test('horizontal mode', async () => {
const onOpen = jest.fn()
const wrapper = _mount(
`<el-menu mode="horizontal">
`<el-menu mode="horizontal" @open="onOpen">
<el-menu-item index="1"></el-menu-item>
<el-sub-menu index="2" ref="submenu">
<template slot="title"></template>
@ -402,7 +403,12 @@ describe('other', () => {
<el-menu-item index="2-3">3</el-menu-item>
</el-sub-menu>
<el-menu-item index="3"></el-menu-item>
</el-menu>`
</el-menu>`,
{
methods: {
onOpen,
},
}
)
await nextTick()
@ -415,9 +421,7 @@ describe('other', () => {
await nextTick()
await rAF()
expect(
document.body.querySelector('body [role="tooltip"]').getAttribute('style')
).not.toContain('display: none')
expect(onOpen).toHaveBeenCalled()
})
test('menu group', async () => {
const wrapper = _mount(

View File

@ -3,6 +3,7 @@
ref="popperContentRef"
:style="contentStyle"
:class="contentClass"
role="tooltip"
@mouseenter="(e) => $emit('mouseenter', e)"
@mouseleave="(e) => $emit('mouseleave', e)"
>

View File

@ -100,6 +100,10 @@
var(--el-cascader-menu-border),
var(--el-cascader-menu-shadow)
);
&.#{$namespace}-popper {
box-shadow: var(--el-cascader-menu-shadow);
}
}
@include e(tags) {

View File

@ -7,6 +7,7 @@
@include b(picker) {
@include e(popper) {
@include set-css-var-type('datepicker', 'border-color', $datepicker);
@include picker-popper(
var(--el-color-white),
1px solid var(--el-datepicker-border-color),