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

fix(VProgressLinear) render in forced-colors mode #20112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

06b
Copy link
Contributor

@06b 06b commented Jul 5, 2024

Description

fixes #20111

image

Markup:

<template>
  <v-app>
    <v-container>
      <v-row dense>
        <v-col>
          <h1 class="text-subtitle-1">Native Progress Indicator Element</h1>
          <progress id="file" max="100" value="70" />
          <br>
          <progress id="progress-bar" aria-label="Content loading…" />
        </v-col>

        <v-col>
          <h1 class="text-subtitle-1">Vuetify Progress Indicator</h1>
          <v-progress-linear color="orange" model-value="20" />
          <br>
          <v-progress-linear color="green" indeterminate />
          <br>
          <v-progress-linear model-value="20" rounded />
          <br>
          <v-progress-linear indeterminate rounded />
          <br>
          <v-progress-linear
            v-model="value"
            :buffer-value="bufferValue"
            color="deep-orange"
          />
          <br>
          <v-progress-linear
            buffer-value="60"
            color="red-lighten-2"
            model-value="40"
            stream
          />
        </v-col>

      </v-row>
    </v-container>
  </v-app>
</template>

<script>
  export default {
    name: 'Playground',
    setup () {
      return {
        //
      }
    },
    data () {
      return {
        value: 10,
        bufferValue: 20,
        interval: 0,
      }
    },

    watch: {
      value (val) {
        if (val < 100) return

        this.value = 0
        this.bufferValue = 10
        this.startBuffer()
      },
    },

    mounted () {
      this.startBuffer()
    },

    beforeUnmount () {
      clearInterval(this.interval)
    },

    methods: {
      startBuffer () {
        clearInterval(this.interval)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant