mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [el-date-picker] ignore special flag (#5200)
fix #5067
This commit is contained in:
@@ -325,6 +325,26 @@ describe('DatePicker', () => {
|
||||
expect(text.includes('csw')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('custom content bail out slot compoent', async () => {
|
||||
_mount(
|
||||
`<el-date-picker
|
||||
v-model="value"
|
||||
ref="input">
|
||||
<slot name="testest"></slot>
|
||||
</el-date-picker>`,
|
||||
() => ({ value: '' }),
|
||||
{
|
||||
mounted() {
|
||||
this.$refs.input.focus()
|
||||
},
|
||||
}
|
||||
)
|
||||
await nextTick()
|
||||
const el = document.querySelector<HTMLElement>('td.available')
|
||||
const text = el.textContent
|
||||
expect(!!text).toBeTruthy()
|
||||
})
|
||||
|
||||
describe('value-format', () => {
|
||||
it('with literal string', async () => {
|
||||
const day = dayjs()
|
||||
|
||||
@@ -16,7 +16,9 @@ export default defineComponent({
|
||||
const cell = props.cell
|
||||
if (picker?.ctx.slots.default) {
|
||||
const list = picker.ctx.slots.default(cell).filter((item) => {
|
||||
return item.type.toString() !== 'Symbol(Comment)'
|
||||
return (
|
||||
item.patchFlag !== -2 && item.type.toString() !== 'Symbol(Comment)'
|
||||
)
|
||||
})
|
||||
if (list.length) {
|
||||
return list
|
||||
|
||||
Reference in New Issue
Block a user