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

refactor(group/layout/helpers): remove findChildrenWithProvide reliance #21118

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

johnleider
Copy link
Member

@johnleider johnleider commented Mar 18, 2025

Apparently this will break Vue vapor mode. I removed it's usage in layout and group and everything seems to still work fine. Docs are a bit jacked up but that could be something we're doing wrong. Needs more investigation but this is at least a start. There are obviously some issues and 2 unit tests fail.

This is to get the conversation going.

Markup:

<template>
  <v-card>
    <v-layout>
      <v-app-bar color="primary">
        <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer" />

        <v-toolbar-title>My files</v-toolbar-title>

        <v-spacer />

        <template v-if="$vuetify.display.mdAndUp">
          <v-btn icon="mdi-magnify" variant="text" />

          <v-btn icon="mdi-filter" variant="text" />
        </template>

        <v-btn icon="mdi-dots-vertical" variant="text" />
      </v-app-bar>

      <v-navigation-drawer
        v-model="drawer"
        :location="$vuetify.display.mobile ? 'bottom' : undefined"
        temporary
      >
        <v-list
          :items="items"
        />
      </v-navigation-drawer>

      <v-main style="height: 500px;">
        <v-card-text>
          The navigation drawer will appear from the bottom on smaller size screens.
        </v-card-text>
      </v-main>
    </v-layout>
  </v-card>
</template>
<script setup>
  import { ref, watch } from 'vue'

  const items = [
    {
      title: 'Foo',
      value: 'foo',
    },
    {
      title: 'Bar',
      value: 'bar',
    },
    {
      title: 'Fizz',
      value: 'fizz',
    },
    {
      title: 'Buzz',
      value: 'buzz',
    },
  ]

  const drawer = ref(false)
  const group = ref(null)

  watch(group, () => {
    drawer.value = false
  })
</script>

@johnleider johnleider requested a review from a team March 18, 2025 03:53
@johnleider johnleider added this to the v3.x.x milestone Mar 18, 2025
@johnleider johnleider added T: enhancement Functionality that enhances existing features E: group Group composable E: layout Layout composable vapor labels Mar 18, 2025
@KaelWD
Copy link
Member

KaelWD commented Mar 18, 2025

This will break when render order != template order.

<template>
  <v-app>
    <v-container>
      <v-tabs v-model="tab">
        <v-tab>0</v-tab>
        <v-tab v-if="showOne">1</v-tab>
        <v-tab>2</v-tab>
      </v-tabs>

      <pre>{{ tab }}</pre>
      <v-switch v-model="showOne" />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const tab = ref()
  const showOne = ref(true)
</script>

Yeah you can see the tests for this case are failing too. It might be possible to do something similar with vapor, I haven't explored it at all yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E: group Group composable E: layout Layout composable T: enhancement Functionality that enhances existing features vapor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants