Skip to content

feat(VBadge): add size width and height props to VBadge (#28037)#21509

Merged
jcjp merged 2 commits intodevfrom
feat(VBadge)/add-size-props-to-vbadge
Jun 8, 2025
Merged

feat(VBadge): add size width and height props to VBadge (#28037)#21509
jcjp merged 2 commits intodevfrom
feat(VBadge)/add-size-props-to-vbadge

Conversation

@jcjp
Copy link
Contributor

@jcjp jcjp commented May 31, 2025

Description

Markup:

<template>
  <v-container>
    <v-badge width="28px" height="30px" content="1" />
  </v-container>
</template>

@jcjp jcjp requested a review from a team May 31, 2025 15:49
@jcjp jcjp self-assigned this May 31, 2025
@jcjp jcjp added T: feature A new feature C: VBadge labels May 31, 2025
@jcjp jcjp changed the base branch from master to dev May 31, 2025 15:50
@jcjp jcjp force-pushed the feat(VBadge)/add-size-props-to-vbadge branch from 7bc411e to 12b6f9c Compare June 4, 2025 10:29
@jcjp jcjp enabled auto-merge (squash) June 4, 2025 10:30
J-Sek
J-Sek previously requested changes Jun 7, 2025
@J-Sek
Copy link
Contributor

J-Sek commented Jun 7, 2025

Is it OK that these are not reactive? Ofc, we could patch it later after learning about some real-life use cases proving it matters.

Playground
<template>
  <v-container max-width="400">
    <v-slider
      v-model="height"
      label="height"
      max="100"
      min="0"
      step="1"
    />
    <v-slider
      v-model="width"
      label="width"
      max="100"
      min="0"
      step="1"
    />
  </v-container>
  <v-container max-width="400">
    <v-badge :key="height + width" :height="height" :width="width" content="123" />
  </v-container>
</template>

<script setup lang="ts">
  import { ref } from 'vue'
  const height = ref<number | null>(null)
  const width = ref<number | null>(null)
</script>

@jcjp
Copy link
Contributor Author

jcjp commented Jun 8, 2025

Is it OK that these are not reactive? Ofc, we could patch it later after learning about some real-life use cases proving it matters.

Do you mean to say that the width and height are not reactive?

@jcjp jcjp dismissed J-Sek’s stale review June 8, 2025 05:24

Updated to simplify the solution thanks J-Sek!

@jcjp jcjp requested a review from J-Sek June 8, 2025 05:25
@J-Sek
Copy link
Contributor

J-Sek commented Jun 8, 2025

Do you mean to say that the width and height are not reactive?

The changes did not seem to be reflected unless I had :key= to reset the badge. I was using the playground from my previous comment.

Your last commit fixed it by passing props straight to the composable without extracting width and height. :)

@jcjp jcjp merged commit b87f179 into dev Jun 8, 2025
25 of 27 checks passed
@jcjp jcjp deleted the feat(VBadge)/add-size-props-to-vbadge branch June 8, 2025 08:35
@KaelWD KaelWD added this to the v3.9.0 (Zealot) milestone Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Dynamically set size of badge

3 participants