Subscribe on changes!

Namespaced Components with dynamic accessor Component.[dynamic]

avatar
Jun 1st 2022

Feature suggestion

add support for dynamic namespace components

let selected = "a"
<MyComponent.[selected]></MyComponent.[selected]>

in the spirit of https://vuejs.org/guide/components/slots.html#dynamic-slot-names

Vue version

3.2.36

Link to minimal reproduction

https

What is expected?

MyComponent.[selected] will compile to

  return (_openBlock(), _createBlock( MyComponent[selected] ))
avatar
Jun 2nd 2022

actually this is possible in a different variation using a getter

const MyComponents = {
 get selected(){
  return ref.value
 }
}
<MyComponent.selected></MyComponent.selected>