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

feat(VProgressLinear): add separate buffer color and opacity props #19190

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Feb 8, 2024

Screenshot_20240208_160029

https://v2.vuetifyjs.com/en/components/progress-linear/#buffer-value

Markup:

<template>
  <div>
    <pre>{{ { value, bufferValue } }}</pre>
    <v-progress-linear
      v-model="value"
    />
    <br>
    <v-progress-linear
      v-model="value"
      stream
    />
    <br>
    <v-progress-linear
      v-model="value"
      :buffer-value="bufferValue"
      stream
      bg-opacity="0"
    />
    <br>
    <v-progress-linear
      v-model="value"
      :buffer-value="bufferValue"
      color="purple"
      buffer-color="primary"
      buffer-opacity="1"
    />
    <br>
    <v-progress-linear
      v-model="value"
      :buffer-value="bufferValue"
      color="red-lighten-2"
    />
    <br>
    <v-progress-linear
      v-model="value"
      :buffer-value="bufferValue"
      color="black"
      bg-opacity="0"
    />
  </div>
</template>

<script setup>
  import { onBeforeUnmount, onMounted, ref, watch } from 'vue'

  const value = ref(10)
  const bufferValue = ref(20)
  const interval = ref(0)

  watch(value, val => {
    if (val < 100) return
    value.value = 0
    bufferValue.value = 10
    startBuffer()
  })

  onMounted(() => {
    startBuffer()
  })
  onBeforeUnmount(() => {
    clearInterval(interval.value)
  })

  function startBuffer () {
    clearInterval(interval.value)
    interval.value = setInterval(() => {
      value.value += Math.random() * (15 - 5) + 5
      bufferValue.value += Math.random() * (15 - 5) + 6
    }, 2000)
  }
</script>

@KaelWD KaelWD added this to the v3.6.0 (Nebula) milestone Feb 8, 2024
@KaelWD KaelWD self-assigned this Feb 8, 2024
@KaelWD KaelWD added T: enhancement Functionality that enhances existing features T: feature A new feature C: VProgressLinear VProgressLinear labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VProgressLinear VProgressLinear T: enhancement Functionality that enhances existing features T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants