File tree Expand file tree Collapse file tree 6 files changed +79
-0
lines changed
views/component_built_in_example Expand file tree Collapse file tree 6 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,14 @@ const routes: RouteRecordRaw = {
182182 title : '浮动面板' ,
183183 } ,
184184 } ,
185+ {
186+ path : 'progress' ,
187+ name : 'componentExampleBuiltInProgress' ,
188+ component : ( ) => import ( '@/views/component_built_in_example/progress.vue' ) ,
189+ meta : {
190+ title : '进度条' ,
191+ } ,
192+ } ,
185193 {
186194 path : 'scrollarea' ,
187195 name : 'componentExampleBuiltInScrollarea' ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ declare module 'vue' {
3434 FaPasswordStrength : typeof import ( './../ui/components/FaPasswordStrength/index.vue' ) [ 'default' ]
3535 FaPinInput : typeof import ( './../ui/components/FaPinInput/index.vue' ) [ 'default' ]
3636 FaPopover : typeof import ( './../ui/components/FaPopover/index.vue' ) [ 'default' ]
37+ FaProgress : typeof import ( './../ui/components/FaProgress/index.vue' ) [ 'default' ]
3738 FaScrollArea : typeof import ( './../ui/components/FaScrollArea/index.vue' ) [ 'default' ]
3839 FaSearchBar : typeof import ( './../ui/components/FaSearchBar/index.vue' ) [ 'default' ]
3940 FaSelect : typeof import ( './../ui/components/FaSelect/index.vue' ) [ 'default' ]
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from ' vue'
3+ import { Progress } from ' ./progress'
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [' class' ]
7+ }>()
8+
9+ const modelValue = defineModel <number >({
10+ default: 0 ,
11+ })
12+ </script >
13+
14+ <template >
15+ <Progress v-bind =" props" :model-value =" modelValue" />
16+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { ProgressRootProps } from ' reka-ui'
3+ import type { HTMLAttributes } from ' vue'
4+ import { cn } from ' @/utils'
5+ import {
6+ ProgressIndicator ,
7+ ProgressRoot ,
8+ } from ' reka-ui'
9+ import { computed } from ' vue'
10+
11+ const props = withDefaults (
12+ defineProps <ProgressRootProps & { class? : HTMLAttributes [' class' ] }>(),
13+ {
14+ modelValue: 0 ,
15+ },
16+ )
17+
18+ const delegatedProps = computed (() => {
19+ const { class : _, ... delegated } = props
20+
21+ return delegated
22+ })
23+ </script >
24+
25+ <template >
26+ <ProgressRoot
27+ v-bind =" delegatedProps"
28+ :class ="
29+ cn(
30+ 'relative h-4 w-full overflow-hidden rounded-full bg-secondary',
31+ props.class,
32+ )
33+ "
34+ >
35+ <ProgressIndicator
36+ class =" h-full w-full flex-1 bg-primary transition-all"
37+ :style =" `transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
38+ />
39+ </ProgressRoot >
40+ </template >
Original file line number Diff line number Diff line change 1+ export { default as Progress } from './Progress.vue'
Original file line number Diff line number Diff line change 1+ <route lang="yaml">
2+ meta :
3+ enabled : false
4+ </route >
5+
6+ <template >
7+ <div >
8+ <FaPageHeader title =" 进度条" description =" FaProgress" />
9+ <FaPageMain >
10+ <FaProgress :model-value =" 33" />
11+ </FaPageMain >
12+ </div >
13+ </template >
You can’t perform that action at this time.
0 commit comments