mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [cascader] add prefix slot
This commit is contained in:
@@ -559,4 +559,19 @@ describe('Cascader.vue', () => {
|
|||||||
expect(emptySlotEl?.textContent).toBe('-=-empty-=-no-data')
|
expect(emptySlotEl?.textContent).toBe('-=-empty-=-no-data')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('render prefix slot', () => {
|
||||||
|
it('correct render prefix slot', async () => {
|
||||||
|
_mount(() => (
|
||||||
|
<Cascader>
|
||||||
|
{{
|
||||||
|
prefix: () => <div>-=-prefix-=-</div>,
|
||||||
|
}}
|
||||||
|
</Cascader>
|
||||||
|
))
|
||||||
|
|
||||||
|
const prefixSlotEl = document.querySelector('.el-input__prefix-inner')
|
||||||
|
expect(prefixSlotEl?.textContent).toBe('-=-prefix-=-')
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
@blur="handleBlur"
|
@blur="handleBlur"
|
||||||
@input="handleInput"
|
@input="handleInput"
|
||||||
>
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<slot name="prefix" />
|
||||||
|
</template>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<el-icon
|
<el-icon
|
||||||
v-if="clearBtnVisible"
|
v-if="clearBtnVisible"
|
||||||
|
|||||||
Reference in New Issue
Block a user