Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving adds spaces to v-for if nested template element assigns type to slot props #2757

Closed
0biWanKenobi opened this issue Apr 28, 2023 · 0 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@0biWanKenobi
Copy link

Let me add an example to make it clearer:

<!--  spaces will be added after "in" and "visibleColumns" at each save
                     _______________
                                   |            -->
<q-card v-for="(column, i) in visibleColumns" :key="`column-${i}`">
  <v-draggable>

<!-- adding the type definition causes spaces to be added
      _______________________________
                                     |            -->
    <template #item="{ element } : {element: SomeType}">
      <!-- other nested components-->
    </template>
  </v-draggable>
</q-card>

So everytime we save, we'll get progressively more space, something like

v-for="(column, i) in      visibleColumns     "

Spaces will also be added to any props that are bound to values and not receiving strings, but just once, not on every save. These are the elements inside of the template, as you can see all props after

<template #item="{ element } : {element: SomeType}">

have one space before and after the double quotes.

<template #item="{ element } : {element: SomeType}">
    <div class="ux-kanban-draggable-item">
      <slot name="lane-item" :item=" element " :master=" swimlane.masterItem ">
        <UXKanbanBaseItem :title=" element.title " class="q-ma-md" />
      </slot>
    </div>
  </template>

Removing : {element: SomeType} solves the issue, but it's just a bandaid of course.

@0biWanKenobi 0biWanKenobi changed the title Saving adds spaces to v-for if nested template element assigns type to interpolated props Saving adds spaces to v-for if nested template element assigns type to slot props Apr 28, 2023
@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants