According to documentation route parameter should be generated as required when it's created by underscored directory. It is not.

is generating:
{
path: "/ile-kosztuje/usluga/:service?",
component: _6fec3b26,
name: "ile-kosztuje-usluga-service"
}
Can you create _service.vue instead of being a directory?
So you will have:
I have a issue with the solution. Why create a new index.vue just to mitigate the optional? Why not just make the directory behaviour default for compulsory parameters? Also top level _dir seems to work but nested ones do not. What is the reason for not supporting it in the nested ones? I think this is a bug either documention or implementation.
Was there ever an answer to this? What the OP is asking can certainly be accomplished in the component itself. But as he mentioned - the behavior doesn't match what the docs say. Creating /post/_id/index.vue still creates an optional parameter.
@lfallo1 did you solved this issue?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Was there ever an answer to this? What the OP is asking can certainly be accomplished in the component itself. But as he mentioned - the behavior doesn't match what the docs say. Creating /post/_id/index.vue still creates an optional parameter.