mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
fix(components): [tree-select] fix filter no matching data error (#17473)
* fix(components): [tree-select] fix filter no matching data error * fix: immediate
This commit is contained in:
parent
6032af5405
commit
fc15cad898
@ -225,6 +225,10 @@ describe('TreeSelect.vue', () => {
|
||||
tree.vm.filter('一级 1')
|
||||
await nextTick()
|
||||
expect(tree.findAll('.el-tree-node:not(.is-hidden)').length).toBe(1)
|
||||
expect(document.querySelector('.el-select-dropdown__empty')).toBeFalsy()
|
||||
tree.vm.filter('no match')
|
||||
await nextTick()
|
||||
expect(document.querySelector('.el-select-dropdown__empty')).toBeTruthy()
|
||||
})
|
||||
|
||||
test('props', async () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { defineComponent, getCurrentInstance, nextTick } from 'vue'
|
||||
import { defineComponent, getCurrentInstance, nextTick, watch } from 'vue'
|
||||
import { ElOption } from '@element-plus/components/select'
|
||||
|
||||
const component = defineComponent({
|
||||
@ -26,6 +26,16 @@ const component = defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => ctx.attrs.visible,
|
||||
(val) => {
|
||||
result.states.visible = val
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
)
|
||||
|
||||
return result
|
||||
},
|
||||
methods: {
|
||||
|
@ -138,6 +138,7 @@ export const useTree = (
|
||||
value: getNodeValByProp('value', data),
|
||||
label: getNodeValByProp('label', data),
|
||||
disabled: getNodeValByProp('disabled', data),
|
||||
visible: node.visible,
|
||||
},
|
||||
props.renderContent
|
||||
? () => props.renderContent(h, { node, data, store })
|
||||
|
Loading…
Reference in New Issue
Block a user