VEUI

VEUI on GitHub
Play!中文

Progress

Examples

Progress bar

Progress
66.6%
Edit this demo on GitHubEdit
<template>
<article>
  <section class="settings">
    Progress
    <veui-slider
      v-model="value"
      class="slider"
      :min="0"
      :step="0.1"
      :max="100"
    />
  </section>
  <section class="settings">
    <veui-checkbox v-model="desc">
      Show description
    </veui-checkbox>
    <veui-checkbox
      v-model="autosucceed"
      :true-value="200"
    >
      Autosucceed
    </veui-checkbox>
    <veui-checkbox
      v-model="indeterminate"
    >
      Indeterminate
    </veui-checkbox>
  </section>
  <section>
    <veui-progress
      :value="value"
      :desc="desc"
      :autosucceed="autosucceed"
      :indeterminate="indeterminate"
      :decimal-place="1"
      :min="0"
      :max="100"
    />
  </section>
</article>
</template>

<script>
import { Progress, Slider, Checkbox } from 'veui'

export default {
  components: {
    'veui-progress': Progress,
    'veui-slider': Slider,
    'veui-checkbox': Checkbox
  },
  data () {
    return {
      type: 'bar',
      value: 66.6,
      desc: true,
      autosucceed: 200,
      indeterminate: false
    }
  }
}
</script>

<style lang="less" scoped>
article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings {
  display: flex;
  align-items: center;
  gap: 20px;
}

.slider {
  width: 200px;
}
</style>

Progress circle

Progress
66.6%
Edit this demo on GitHubEdit
<template>
<article>
  <section class="settings">
    Progress
    <veui-slider
      v-model="value"
      class="slider"
      :min="0"
      :step="0.1"
      :max="100"
    />
  </section>
  <section class="settings">
    <veui-checkbox v-model="desc">
      Show description
    </veui-checkbox>
    <veui-checkbox
      v-model="autosucceed"
      :true-value="200"
    >
      Autosucceed
    </veui-checkbox>
  </section>
  <section>
    <veui-progress
      type="circular"
      :value="value"
      :desc="desc"
      :autosucceed="autosucceed"
      :decimal-place="1"
      :min="0"
      :max="100"
    />
  </section>
</article>
</template>

<script>
import { Progress, Slider, Checkbox } from 'veui'

export default {
  components: {
    'veui-progress': Progress,
    'veui-slider': Slider,
    'veui-checkbox': Checkbox
  },
  data () {
    return {
      value: 66.6,
      desc: true,
      autosucceed: 200
    }
  }
}
</script>

<style lang="less" scoped>
article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings {
  display: flex;
  align-items: center;
  gap: 20px;
}

.slider {
  width: 200px;
}
</style>

Size variants

Available size variants for the ui prop: xs / s / m.

71%
71%
Edit this demo on GitHubEdit
<template>
<article>
  <section>
    <veui-checkbox v-model="fluid">
      Fluid layout (bar)
    </veui-checkbox>
  </section>
  <section class="bar">
    <veui-progress
      :ui="`m ${fluid ? 'fluid' : ''}`"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
    <veui-progress
      :ui="`s ${fluid ? 'fluid' : ''}`"
      status="success"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
    <veui-progress
      :ui="`xs ${fluid ? 'fluid' : ''}`"
      status="error"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
  </section>
  <section class="circular">
    <veui-progress
      type="circular"
      ui="m"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
    <veui-progress
      type="circular"
      ui="s"
      status="success"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
    <veui-progress
      type="circular"
      ui="xs"
      status="error"
      :value="71.1"
      :min="0"
      :max="100"
      desc
    />
  </section>
</article>
</template>

<script>
import { Progress, Checkbox } from 'veui'

export default {
  components: {
    'veui-progress': Progress,
    'veui-checkbox': Checkbox
  },
  data () {
    return {
      fluid: false
    }
  }
}
</script>

<style lang="less" scoped>
section + section {
  margin-top: 20px;
}

.bar,
.circular {
  display: flex;
  gap: 20px;
}

.bar {
  flex-direction: column;
}
</style>

API

Props

NameTypeDefaultDescription
uistring-

Predefined styles.

ValueDescription
fluidFluid style of bar progress.
xsExtra small size style.
sSmall size style.
mMedium size style.
typestring'bar'Type of progress bar. Available values are bar / circular, which are for bar and circular progress bars respectively.
descbooleanfalseWhether to display text hint.
valuenumber0Progress value.
minnumber0Minimum value.
maxnumber1Maximum value.
decimal-placenumber0Number of decimal places to keep.
statusstring-

.sync

Progress status. Available values are success / error, which represent the success and error status respectively.

autosucceedboolean | number-Whether to automatically enter the success state when the progress value reaches the maximum. true means directly entering the success state. If it is of type number, it means the number of milliseconds to wait before switching to the success state after reaching the maximum value.
indeterminatebooleanfalseWhether the progress is indeterminate. Currently only effective when type is bar.

Slots

NameDescription
default

Can be used to customize the content of the text hint area.

Default content: completion percentage.

NameTypeDescription
percentnumberPercentage of progress completion.
valuenumberProgress value, same as value prop.
statusstringProgress status, same as status prop.
afterCan be used to customize the content after the text hint area. Slot props refer to the default slot.
Edit this page on GitHubEdit
© Baidu, Inc. 2024