-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
v-slot with v-if #9391
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
Comments
The new syntax requires Proper usage: <Dropdown>
<template #title>
<template v-if="flag">Bonjour</template>
<template v-else>Hello</template>
</template>
</Dropdown> Maybe we can add a warning for this. |
Will the slot syntax be removed in a future release? |
@frlinw likely, but only in a major release. |
Additionnally, if you put v-if/v-else on a parent, it requires a |
@yyx990803 I think this will prevent conditional rendering of slots. <vg-apollo-query
:query="query"
:variables="variables"
:prefetch="prefetch"
v-on="$listeners"
>
<template #default="{ result: { data, error }, isLoading, gqlError }">
<template
v-if="isLoading"
#initialLoading
>
<div data-test-initial-loading class="spinner-icon" />
</template>
</vg-apollo-query> |
- Files in `docs/pages/components/table/examples` are updated. - In `ExAsyncData.vue`, - The `truncate` filter is removed and implemented as a method because Vue 3 no longer supports filters. - In `ExCheckable.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `checked-rows.sync` --> `v-model:checked-rows`. - In `ExCustomDetailedRow.vue`, - Obsolete `slot` and `slot-scope` directives in a template are replaced with `v-slot`. - In `ExFooter.vue`, - `v-if` and `v-else` directives are enclosed in a separate template with `#footer` (`v-slot`) directive. Combining `v-if` or `v-else`, and `v-slot` in a same template caused a maximum recursion exceeding error. If `v-slot` was inside `v-if`, I got a compilation error. Wrapping a `v-if` or `v-else` directive with a `v-slot` looks a proper syntax, vuejs/vue#9391 (comment) This change lets `Table` component take a fragment into account when a footer is rendered. - In `ExPaginationSort.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:current-page.sync` --> `v-model:current-page`. - In `ExSelection.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:selected.sync` --> `v-model:selected`. - In `ExSortMultiple.vue`, - `!multiColumnSortingEnabled` is replaced with `multiColumnSortingDisabledOrUndefined` when `disabled` attribute is set. Because setting a boolean attribute `false` does not remove it on Vue 3. To remove an attribute, `null` or `undefined` has to be given. `multiColumnSortingDisabledOrUndefined` returns `true` or `undefined`.
- Files in `docs/pages/components/table/examples` are updated. - In `ExAsyncData.vue`, - The `truncate` filter is removed and implemented as a method because Vue 3 no longer supports filters. - In `ExCheckable.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `checked-rows.sync` --> `v-model:checked-rows`. - In `ExCustomDetailedRow.vue`, - Obsolete `slot` and `slot-scope` directives in a template are replaced with `v-slot`. - In `ExFooter.vue`, - `v-if` and `v-else` directives are enclosed in a separate template with `#footer` (`v-slot`) directive. Combining `v-if` or `v-else`, and `v-slot` in a same template caused a maximum recursion exceeding error. If `v-slot` was inside `v-if`, I got a compilation error. Wrapping a `v-if` or `v-else` directive with a `v-slot` looks a proper syntax, vuejs/vue#9391 (comment) This change lets `Table` component take a fragment into account when a footer is rendered. - In `ExPaginationSort.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:current-page.sync` --> `v-model:current-page`. - In `ExSelection.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:selected.sync` --> `v-model:selected`. - In `ExSortMultiple.vue`, - `!multiColumnSortingEnabled` is replaced with `multiColumnSortingDisabledOrUndefined` when `disabled` attribute is set. Because setting a boolean attribute `false` does not remove it on Vue 3. To remove an attribute, `null` or `undefined` has to be given. `multiColumnSortingDisabledOrUndefined` returns `true` or `undefined`.
- Files in `docs/pages/components/table/examples` are updated. - In `ExAsyncData.vue`, - The `truncate` filter is removed and implemented as a method because Vue 3 no longer supports filters. - In `ExCheckable.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `checked-rows.sync` --> `v-model:checked-rows`. - In `ExCustomDetailedRow.vue`, - Obsolete `slot` and `slot-scope` directives in a template are replaced with `v-slot`. - In `ExFooter.vue`, - `v-if` and `v-else` directives are enclosed in a separate template with `#footer` (`v-slot`) directive. Combining `v-if` or `v-else`, and `v-slot` in a same template caused a maximum recursion exceeding error. If `v-slot` was inside `v-if`, I got a compilation error. Wrapping a `v-if` or `v-else` directive with a `v-slot` looks a proper syntax, vuejs/vue#9391 (comment) This change lets `Table` component take a fragment into account when a footer is rendered. - In `ExPaginationSort.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:current-page.sync` --> `v-model:current-page`. - In `ExSelection.vue`, - `.sync` is replaced with a new syntax of `v-model:`. `:selected.sync` --> `v-model:selected`. - In `ExSortMultiple.vue`, - `!multiColumnSortingEnabled` is replaced with `multiColumnSortingDisabledOrUndefined` when `disabled` attribute is set. Because setting a boolean attribute `false` does not remove it on Vue 3. To remove an attribute, `null` or `undefined` has to be given. `multiColumnSortingDisabledOrUndefined` returns `true` or `undefined`.
Version
2.6.0-beta.3
Reproduction link
https://codepen.io/frlinw/pen/zeobvd
Steps to reproduce
Click on the "click me" button
What is expected?
content should be displayed and changed on click
What is actually happening?
v-slot inside a wrapper with v-if is not displayed
The text was updated successfully, but these errors were encountered: