File tree 2 files changed +9
-15
lines changed
2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div
3
- :class =" classList"
4
- >
2
+ <div :class =" classList" >
5
3
<slot />
6
4
</div >
7
5
</template >
@@ -39,12 +37,13 @@ export default {
39
37
mounted () {
40
38
const sizeList = [' xs' , ' sm' , ' md' , ' lg' ];
41
39
const classList = [];
42
- sizeList .forEach (size => {
43
- if (this [size] && this [size] <= 12 ) {
44
- classList .push (` layui-col-${ size + this [size]} ` );
45
- if (this .offset ) {
46
- classList .push (` layui-col-${ size + ' -offset' + this .offset } ` );
47
- }
40
+ sizeList .forEach (type => {
41
+ const val = this [type];
42
+ if (val && val <= 12 ) {
43
+ classList .push (` layui-col-${ type}${ val} ` );
44
+ }
45
+ if (this .offset ) {
46
+ classList .push (` layui-col-${ type} -offset${ this .offset } ` );
48
47
}
49
48
});
50
49
this .classList = classList;
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div
3
- :class =" [
4
- 'layui-row',
5
- `layui-col-space${space}`
6
- ]"
7
- >
2
+ <div :class =" [ 'layui-row', `layui-col-space${space}` ]" >
8
3
<slot />
9
4
</div >
10
5
</template >
You can’t perform that action at this time.
0 commit comments