File tree Expand file tree Collapse file tree 5 files changed +51
-23
lines changed
types/components/BSkeleton Expand file tree Collapse file tree 5 files changed +51
-23
lines changed Original file line number Diff line number Diff line change 3
3
</template >
4
4
5
5
<script setup lang="ts">
6
- import {computed , PropType , StyleValue } from ' vue'
7
- import type {ColorVariant , SkeletonAnimation , SkeletonType } from ' ../../types'
6
+ // import type {BSkeletonProps} from '@/types/components'
7
+ import {computed , StyleValue } from ' vue'
8
+ import type {ColorVariant , SkeletonAnimation , SkeletonType } from ' @/types'
8
9
9
- const props = defineProps ({
10
- animation: {type: String as PropType <SkeletonAnimation >, default: ' wave' },
11
- height: {type: String },
12
- size: {type: String },
13
- type: {type: String as PropType <SkeletonType >, default: ' text' },
14
- variant: {type: String as PropType <ColorVariant >},
15
- width: {type: String },
10
+ interface BSkeletonProps {
11
+ height? : string
12
+ width? : string
13
+ size? : string
14
+ animation? : SkeletonAnimation
15
+ type? : SkeletonType
16
+ variant? : ColorVariant
17
+ }
18
+
19
+ const props = withDefaults (defineProps <BSkeletonProps >(), {
20
+ animation: ' wave' ,
21
+ type: ' text' ,
16
22
})
17
23
18
24
const classes = computed (() => [
Original file line number Diff line number Diff line change 8
8
</template >
9
9
10
10
<script setup lang="ts">
11
- import {computed , PropType } from ' vue'
12
- import type {SkeletonAnimation } from ' ../../types'
11
+ // import type {BSkeletonIconProps} from '@/types/components'
12
+ import {computed } from ' vue'
13
+ import type {SkeletonAnimation } from ' @/types'
13
14
14
- const props = defineProps ({
15
- animation: {type: String as PropType <SkeletonAnimation >, default: ' wave' },
15
+ interface BSkeletonIconProps {
16
+ animation? : SkeletonAnimation
17
+ }
18
+
19
+ const props = withDefaults (defineProps <BSkeletonIconProps >(), {
20
+ animation: ' wave' ,
16
21
})
17
22
18
23
const classes = computed (() => [` b-skeleton-animate-${props .animation } ` ])
Original file line number Diff line number Diff line change 25
25
</template >
26
26
27
27
<script setup lang="ts">
28
+ // import type {BSkeletonTableProps} from '@/types/components'
29
+ import type {SkeletonAnimation } from ' @/types'
28
30
import BTableSimple from ' ../BTable/BTableSimple.vue'
29
31
import BSkeleton from ' ./BSkeleton.vue'
30
32
31
- defineProps ({
32
- animation: {type: String , default: ' wave' },
33
- columns: {type: Number , default: 5 },
34
- hideHeader: {type: Boolean , default: false },
35
- rows: {type: Number , default: 3 },
36
- showFooter: {type: Boolean , default: false },
37
- tableProps: {type: Object },
33
+ interface BSkeletonTableProps {
34
+ animation? : SkeletonAnimation
35
+ columns? : number
36
+ hideHeader? : boolean
37
+ rows? : number
38
+ showFooter? : boolean
39
+ tableProps: Record <string , unknown >
40
+ }
41
+
42
+ withDefaults (defineProps <BSkeletonTableProps >(), {
43
+ animation: ' wave' ,
44
+ columns: 5 ,
45
+ hideHeader: false ,
46
+ rows: 3 ,
47
+ showFooter: false ,
38
48
})
39
49
</script >
Original file line number Diff line number Diff line change 4
4
</template >
5
5
6
6
<script setup lang="ts">
7
- defineProps ({
8
- loading: {type: Boolean , default: false },
7
+ // import type {BSkeletonWrapperProps} from '@/types/components'
8
+
9
+ interface BSkeletonWrapperProps {
10
+ loading? : boolean
11
+ }
12
+
13
+ withDefaults (defineProps <BSkeletonWrapperProps >(), {
14
+ loading: false ,
9
15
})
10
16
</script >
Original file line number Diff line number Diff line change
1
+ import type { SkeletonAnimation } from '@/types'
1
2
// Props
2
3
export interface Props {
3
- animation ?: string
4
+ animation ?: SkeletonAnimation
4
5
columns ?: number
5
6
hideHeader ?: boolean
6
7
rows ?: number
You can’t perform that action at this time.
0 commit comments