6
6
7
7
<script lang="ts">
8
8
import {computed , defineComponent , PropType } from ' vue'
9
- import type {Alignment } from ' .. /types'
10
- import getBreakpointProps from ' .. /utils/getBreakpointProps'
11
- import getClasses from ' .. /utils/getClasses'
9
+ import type {Alignment } from ' @ /types'
10
+ import getBreakpointProps from ' @ /utils/getBreakpointProps'
11
+ import getClasses from ' @ /utils/getClasses'
12
12
13
13
const breakpointCol = getBreakpointProps (' ' , [], {type: [Boolean , String , Number ], default: false })
14
14
const breakpointOffset = getBreakpointProps (' offset' , [' ' ], {type: [String , Number ], default: null })
@@ -28,19 +28,15 @@ export default defineComponent({
28
28
tag: {type: String , default: ' div' },
29
29
},
30
30
setup(props ) {
31
- let classList: string [] = []
32
-
33
31
const properties = [
34
32
{content: breakpointCol , propPrefix: ' cols' , classPrefix: ' col' },
35
33
{content: breakpointOffset , propPrefix: ' offset' },
36
34
{content: breakpointOrder , propPrefix: ' order' },
37
35
]
38
36
39
- properties .forEach ((property ) => {
40
- classList = classList .concat (
41
- getClasses (props , property .content , property .propPrefix , property .classPrefix )
42
- )
43
- })
37
+ const classList: Array <string > = properties .flatMap ((el ) =>
38
+ getClasses (props , el .content , el .propPrefix , el .classPrefix )
39
+ )
44
40
45
41
const classes = computed (() => ({
46
42
col: props .col || ! classList .some ((e ) => / ^ col-/ .test (e ) && ! props .cols ),
0 commit comments