Skip to content

Commit 61fc765

Browse files
authored
Merge pull request ftdus#113 from Jan193/feature/createWebAndCreateBaseCpont
🎉 更新组件到官网
2 parents cfff642 + a18a7aa commit 61fc765

File tree

6 files changed

+392
-50
lines changed

6 files changed

+392
-50
lines changed

src/components/col/src/col.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
2-
<div :class="classList" :style="styles">
3-
<slot></slot>
4-
</div>
2+
<div :class="classList" :style="styles"><slot></slot></div>
53
</template>
64
<script>
75
const prefixCls = 'py-col';
@@ -50,21 +48,21 @@ export default {
5048
const classses = [
5149
`${prefixCls}`,
5250
{
53-
[`${prefixCls}__span--${this.span}`]: this.span,
54-
[`${prefixCls}--push-${this.push}`]: this.push,
55-
[`${prefixCls}--pull-${this.pull}`]: this.pull,
56-
[`${prefixCls}--offset-${this.offset}`]: this.offset,
51+
[`${prefixCls}__span-${this.span}`]: this.span,
52+
[`${prefixCls}__push-${this.push}`]: this.push,
53+
[`${prefixCls}__pull-${this.pull}`]: this.pull,
54+
[`${prefixCls}__offset-${this.offset}`]: this.offset,
5755
},
5856
];
5957
this.sizes.forEach(size => {
6058
if (typeof this[size] === 'number') {
61-
classses.push(`${prefixCls}__span--${size}-${this[size]}`);
59+
classses.push(`${prefixCls}__span-${size}-${this[size]}`);
6260
} else if (typeof this[size] === 'object') {
6361
const props = this[size];
6462
Object.keys(props).forEach(prop => {
6563
classses.push(prop !== 'span'
66-
? `${prefixCls}-${size}--${prop}-${props[prop]}`
67-
: `${prefixCls}__span--${size}-${props[prop]}`);
64+
? `${prefixCls}__${size}-${prop}-${props[prop]}`
65+
: `${prefixCls}__span-${size}-${props[prop]}`);
6866
});
6967
}
7068
});

src/components/row/src/row.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
2-
<div :class="classList" :style="styles">
3-
<slot></slot>
4-
</div>
2+
<div :class="classList" :style="styles"><slot></slot></div>
53
</template>
64
<script>
75
const prefixCls = 'py-row';
@@ -71,8 +69,8 @@ export default {
7169
{
7270
// [`${prefixCls}-${this.crevice}`]: this.crevice
7371
[`${prefixCls}__${this.type}`]: this.type,
74-
[`${prefixCls}__flex-${this.justify}`]: this.justify,
75-
[`${prefixCls}__flex-${this.align}`]: this.align,
72+
[`${prefixCls}__flex--${this.justify}`]: this.justify,
73+
[`${prefixCls}__flex--${this.align}`]: this.align,
7674
},
7775
];
7876
},

src/styles/src/col.scss

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,93 @@
11
@charset "UTF-8";
22

3-
$prefixCls: 'py-col';
43
$start: 1;
5-
$end: 24;
4+
$end: 25;
65
$count: 100%/24;
7-
$name: '__span--';
6+
$name: 'span';
87

9-
.#{$prefixCls} {
8+
@include b(col) {
109
position: relative;
1110
float: left;
1211
color: #fff;
1312
padding: 10px 0;
1413
text-align: center;
15-
@for $s from $start to $end {
16-
&#{$name}#{$s} {
14+
}
15+
16+
@for $s from $start to $end {
17+
@include e(span) {
18+
@include m($s) {
1719
width: $count * $s;
1820
}
19-
@media (max-width: 767px) {
20-
&#{$name}xs-#{$s} {
21+
}
22+
@include e(offset) {
23+
@include m($s) {
24+
margin-left: $count * $s;
25+
}
26+
}
27+
@media (max-width: 767px) {
28+
@include e(span) {
29+
@include m(xs-#{$s}) {
2130
display: block;
2231
width: $count * $s;
2332
}
24-
&-xs {
25-
&-offset-#{$s} {
26-
margin-left: $count * $s;
27-
}
33+
}
34+
@include e(xs) {
35+
@include m(offset-#{$s}) {
36+
margin-left: $count * $s;
2837
}
2938
}
30-
@media screen and (min-width: 768px) and (max-width: 991px) {
31-
&#{$name}sm-#{$s} {
39+
}
40+
@media screen and (min-width: 768px) and (max-width: 991px) {
41+
@include e(span) {
42+
@include m(sm-#{$s}) {
3243
display: block;
3344
width: $count * $s;
3445
}
35-
&-sm {
36-
&-offset-#{$s} {
37-
margin-left: $count * $s;
38-
}
46+
}
47+
@include e(sm) {
48+
@include m(offset-#{$s}) {
49+
margin-left: $count * $s;
3950
}
4051
}
41-
@media screen and (min-width: 992px) and (max-width: 1199px) {
42-
&#{$name}md-#{$s} {
52+
}
53+
@media screen and (min-width: 992px) and (max-width: 1199px) {
54+
@include e(span) {
55+
@include m(md-#{$s}) {
4356
display: block;
4457
width: $count * $s;
4558
}
46-
&-md {
47-
&-offset-#{$s} {
48-
margin-left: $count * $s;
49-
}
59+
}
60+
@include e(md) {
61+
@include m(offset-#{$s}) {
62+
margin-left: $count * $s;
5063
}
5164
}
52-
@media (min-width: 1200px) {
53-
&#{$name}lg-#{$s} {
65+
}
66+
@media (min-width: 1200px) {
67+
@include e(span) {
68+
@include m(lg-#{$s}) {
5469
display: block;
5570
width: $count * $s;
5671
}
57-
&-lg {
58-
&-offset-#{$s} {
59-
margin-left: $count * $s;
60-
}
72+
}
73+
@include e(lg) {
74+
@include m(offset-#{$s}) {
75+
margin-left: $count * $s;
6176
}
6277
}
63-
&--offset-#{$s} {
78+
}
79+
@include e(offset) {
80+
@include m($s) {
6481
margin-left: $count * $s;
6582
}
66-
&--push-#{$s} {
83+
}
84+
@include e(push) {
85+
@include m($s) {
6786
left: $count * $s;
6887
}
69-
&--pull-#{$s} {
88+
}
89+
@include e(pull) {
90+
@include m($s) {
7091
right: $count * $s;
7192
}
7293
}

src/styles/src/row.scss

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,43 @@
22

33
$prefixCls: 'py-row';
44

5-
.#{$prefixCls} {
5+
@include b(row) {
6+
position: relative;
7+
&:after {
8+
content: ' ';
9+
display: block;
10+
clear: both;
11+
}
12+
@include e(flex) {
13+
display: flex;
14+
@include m(start) {
15+
justify-content: start;
16+
}
17+
@include m(center) {
18+
justify-content: center;
19+
}
20+
@include m(end) {
21+
justify-content: flex-end;
22+
}
23+
@include m(space-between) {
24+
justify-content: space-between;
25+
}
26+
@include m(space-around) {
27+
justify-content: space-around;
28+
}
29+
@include m(top) {
30+
align-items: flex-start;
31+
}
32+
@include m(bottom) {
33+
align-items: flex-end;
34+
}
35+
@include m(middle) {
36+
align-items: center;
37+
}
38+
}
39+
}
40+
41+
/*.#{$prefixCls} {
642
position: relative;
743
&:after {
844
content: ' ';
@@ -36,4 +72,4 @@ $prefixCls: 'py-row';
3672
align-items: center;
3773
}
3874
}
39-
}
75+
}*/

0 commit comments

Comments
 (0)