Förloppsindikator används för att visa status för en operation som förväntas ta relativt lång tid.
Visa kod
<template >
<div >
<f-progressbar
:value ="currentProgress"
aria-label ="Progressbar"
label ="Progressbar"
value-text ="You have uploaded %VALUE% %."
> </f-progressbar >
<pre
class ="debug-data"
> <span class ="sr-only" > Debug-data: </span > value: {{currentProgress}}</pre >
<button type ="button" @click ="increase()" > Increase</button >
<button type ="button" @click ="decrease()" > Decrease</button >
<label >
Progress:
<input v-model.number ="currentProgress" type ="number" />
</label >
</div >
</template >
<script >
import { defineComponent } from "vue" ;
import { FProgressbar } from "@fkui/vue" ;
export default defineComponent ({
name : "FProgressbarExample" ,
components : { FProgressbar },
data ( ) {
return {
currentProgress : 40 ,
};
},
methods : {
decrease ( ) {
this .currentProgress = Math .max (this .currentProgress - 20 , 0 );
},
increase ( ) {
this .currentProgress = Math .min (this .currentProgress + 20 , 100 );
},
},
});
</script >
Props Name Description Type Required Default value
Sets the progress. Higher value indicates further progress. Value must be in range 0-100.
number
true
‐
valueText
Text that the screenreader will read, the actual value will be replaced with %VALUE% e.g You have uploaded %VALUE% percent
string
false
"Du har slutfört %VALUE% %."
ariaLabel
‐
string
true
‐