Skip to content

Commit 62100c6

Browse files
committed
fix: 兼容了tailwindcss的flex定义,给flex、row、column类加上vc-前缀,避免全局引入的时候影响到其他地方flex、row、column类的定义
1 parent f732bab commit 62100c6

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

packages/components/ui/btn/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export default defineComponent({
336336
'span',
337337
{
338338
key: 'loading',
339-
class: 'absolute-full flex flex-center'
339+
class: 'absolute-full vc-flex vc-flex-center'
340340
},
341341
slots.loading !== void 0 ? slots.loading() : [h(VcSpinner)]
342342
)

packages/components/ui/fab/fab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export default defineComponent({
3434

3535
const classes = computed(
3636
() =>
37-
'vc-fab z-fab row inline justify-center' +
37+
'vc-fab z-fab vc-row inline justify-center' +
3838
` vc-fab--align-${props.verticalActionsAlign} ${formClass.value}` +
3939
(showing.value === true ? ' vc-fab--opened' : ' vc-fab--closed')
4040
)
4141

4242
const actionClass = computed(
4343
() =>
44-
'vc-fab__actions flex no-wrap inline' +
44+
'vc-fab__actions vc-flex no-wrap inline' +
4545
` vc-fab__actions--${props.direction}` +
4646
` vc-fab__actions--${showing.value === true ? 'opened' : 'closed'}`
4747
)

packages/components/ui/slider/use-slider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export default function ({ updateValue, updatePosition, getDragging, formAttrs }
322322
const filterFn = ({ value }) => value >= props.min && value <= props.max
323323

324324
if (Array.isArray(def) === true) {
325-
return def.map(item => (isObject(item) === true ? item : { value: item })).filter(filterFn)
325+
return def.map(item => (isObject(item) === true ? item : { value: item })).filter((item: any) => filterFn(item))
326326
}
327327

328328
return Object.keys(def)

packages/theme-default/gulpfile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import path from 'path'
1212
import chalk from 'chalk'
1313
import { src, dest, series, parallel } from 'gulp'
14+
import type { TaskFunction } from 'gulp'
1415
import gulpSass from 'gulp-sass'
1516
import dartSass from 'sass'
1617
import autoprefixer from 'gulp-autoprefixer'
@@ -70,7 +71,7 @@ export function copyThemeChalkSource() {
7071
)
7172
}
7273

73-
export const build = parallel(
74+
export const build: TaskFunction = parallel(
7475
copyThemeChalkSource,
7576
series(buildThemeChalk, copyThemeChalkBundle)
7677
)

packages/theme-default/src/core/flex.scss

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
@import '../helpers/string.scss';
44

5+
$flex-prefix: 'vc' !default;
6+
57
@mixin fg($name, $size) {
68
$noProcNotZero: $size > 0;
79

@@ -11,15 +13,15 @@
1113
&-auto,
1214
&-grow,
1315
&-shrink {
14-
.row > &,
15-
.flex > & {
16+
.#{$flex-prefix}-row > &,
17+
.#{$flex-prefix}-flex > & {
1618
width: auto;
1719
min-width: 0;
1820
max-width: 100%;
1921
}
2022

21-
.column > &,
22-
.flex > & {
23+
.#{$flex-prefix}-column > &,
24+
.#{$flex-prefix}-flex > & {
2325
height: auto;
2426
min-height: 0;
2527
max-height: 100%;
@@ -50,7 +52,7 @@
5052
@extend .col#{$name}-auto;
5153
}
5254

53-
.row {
55+
.#{$flex-prefix}-row {
5456
#{str-fe("> .col<name>-<i>", $name, $noProcNotZero, $ic)} {
5557
height: auto;
5658
width: toFixed(percentage(math.div($i, $flex-cols)), 10000);
@@ -63,15 +65,15 @@
6365
}
6466
}
6567

66-
.column {
68+
.#{$flex-prefix}-column {
6769
#{str-fe("> .col<name>-<i>", $name, $noProcNotZero, $ic)} {
6870
height: toFixed(percentage(math.div($i, $flex-cols)), 10000);
6971
width: auto;
7072
}
7173
}
7274

7375
@if $size == 0 and $i == $flex-cols {
74-
.row > .col-all {
76+
.#{$flex-prefix}-row > .col-all {
7577
height: auto;
7678
flex: 0 0 100%;
7779
}
@@ -80,9 +82,9 @@
8082
}
8183
}
8284

83-
.row,
84-
.column,
85-
.flex {
85+
.#{$flex-prefix}-row,
86+
.#{$flex-prefix}-column,
87+
.#{$flex-prefix}-flex {
8688
display: flex;
8789
flex-wrap: wrap;
8890

@@ -91,11 +93,11 @@
9193
}
9294
}
9395

94-
.row.reverse {
96+
.#{$flex-prefix}-row.reverse {
9597
flex-direction: row-reverse;
9698
}
9799

98-
.column {
100+
.#{$flex-prefix}-column {
99101
flex-direction: column;
100102

101103
&.reverse {
@@ -225,7 +227,7 @@
225227
}
226228
}
227229

228-
.flex-center {
230+
.#{$flex-prefix}-flex-center {
229231
@extend .items-center;
230232

231233
@extend .justify-center;

0 commit comments

Comments
 (0)