Subscribe on changes!

Try to modify it instance.slots.default The default method of, unexpected error

avatar
Dec 25th 2020

Version

3.0.4

Reproduction link

http://192.168.3.5:8080/

Steps to reproduce

import {getCurrentInstance,defineComponent} from "vue"

const mapFilterChildCpt = (data,cptName,resArr=[])=>{ data.forEach(itme=>{ if(itme.type.name==cptName){ resArr.push(itme) }else if(itme.shapeFlag==16){ resArr=[...resArr,...mapFilterChildCpt(itme.children||[],cptName)] } }) return resArr }

export default defineComponent({

setup(){ let solt = instance.slots.default instance.slots.default = ()=>{ let child = solt() return mapFilterChildCpt(child,'by-carousel-item',[]) }

}

})

What is expected?

You can modify the default instance.slots.default To modify (filter) the specific components under the slot

What is actually happening?

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Uncaught (in promise) TypeError: Cannot read property 'parentNode' of null at parentNode (runtime-dom.esm-bundler.js?830f:30) at patchBlockChildren (runtime-core.esm-bundler.js?5c40:4009) at processFragment (runtime-core.esm-bundler.js?5c40:4065) at patch (runtime-core.esm-bundler.js?5c40:3708) at patchBlockChildren (runtime-core.esm-bundler.js?5c40:4013) at patchElement (runtime-core.esm-bundler.js?5c40:3977) at processElement (runtime-core.esm-bundler.js?5c40:3795) at patch (runtime-core.esm-bundler.js?5c40:3712) at componentEffect (runtime-core.esm-bundler.js?5c40:4275) at reactiveEffect (reactivity.esm-bundler.js?a1e9:42)

avatar
Dec 25th 2020

Read what I sent you on the other issue you opened with the same invalid reproduction