In the vue documentation, I saw "Namespace Components" in the "Script Settings" guide, where it says:
You can use dotted component tags (such as
) to reference components nested under object properties. This is useful when you import multiple components from a single file:
<script setup> import * as Form from './form-components' </script> <template> <Form.Input> <Form.Label>label</Form.Label> </Form.Input> </template>
I would like to know what the form component looks like in this example, and what is the correct use case for such a component, and how does it relate to "slot".
In this case, form-components references a
.js
file that appears to be exporting a single file component (.vue
) .Form component.js
You can then access these components via:
However, I recommend using the destructuring assignment method since the IDE can explain it better.