Skip to content

Vue generators produce invalid names for scoped slots #380

Open
@J3m5

Description

@J3m5

Description
Vue generators produce invalid names for scoped slots
For example:

     <template #item.admin/books="{ item }">
        <template v-if="router.hasRoute('BookShow')">
          <router-link
            v-for="book in item.raw.admin/books"
            :to="{ name: 'BookShow', params: { id: book['@id'] } }"
            :key="book['@id']"
          >
            {{ book["@id"] }}

            <br />
          </router-link>
        </template>

It show this error: Illegal '/' in tags.vue(22)

How to reproduce
Run the yarn test-gen command and look at the {quasar|vuetify|vue}/components/[foo]/[FooList].vue components

Possible Solution
The named scoped slots use the property names inside the table components to create the table cells and columns.

If we replace the slash with another character, we should make sure the slot name match the real property name from the API.
We need to check how the properties received from the API are named.

Another solution, maybe, would be to use variable for slot names.
But that would mean receiving them as props or declaring them in the script section, but it's not ideal.

Do you have an idea @dunglas ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions