chore: classNames es
parent
87aa5ecbd8
commit
7cec8614b0
|
@ -1,9 +1,27 @@
|
||||||
import { isArray, isString, isObject } from './util';
|
import { isArray, isString, isObject } from './util';
|
||||||
function classNames() {
|
|
||||||
let classes = [];
|
export type ClassArray = ClassValue[];
|
||||||
for (let i = 0; i < arguments.length; i++) {
|
|
||||||
const value = arguments[i];
|
export interface ClassDictionary {
|
||||||
if (!value) continue;
|
[id: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ClassValue =
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| ClassDictionary
|
||||||
|
| ClassArray
|
||||||
|
| undefined
|
||||||
|
| null
|
||||||
|
| boolean;
|
||||||
|
|
||||||
|
function classNames(...args: ClassValue[]): string {
|
||||||
|
const classes = [];
|
||||||
|
for (let i = 0; i < args.length; i++) {
|
||||||
|
const value = args[i];
|
||||||
|
if (!value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (isString(value)) {
|
if (isString(value)) {
|
||||||
classes.push(value);
|
classes.push(value);
|
||||||
} else if (isArray(value)) {
|
} else if (isArray(value)) {
|
|
@ -1,21 +1,5 @@
|
||||||
<<<<<<< HEAD:components/_util/props-util.ts
|
import { isVNode, Fragment, Comment, Text, h, VNode, ComponentPublicInstance } from 'vue';
|
||||||
import isPlainObject from 'lodash/isPlainObject';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import {
|
|
||||||
isVNode,
|
|
||||||
Fragment,
|
|
||||||
Comment,
|
|
||||||
Text,
|
|
||||||
h,
|
|
||||||
VNode,
|
|
||||||
ComponentPublicInstance,
|
|
||||||
PropOptions,
|
|
||||||
} from 'vue';
|
|
||||||
=======
|
|
||||||
import isPlainObject from 'lodash-es/isPlainObject';
|
import isPlainObject from 'lodash-es/isPlainObject';
|
||||||
import classNames from './classNames';
|
|
||||||
import { isVNode, Fragment, Comment, Text, h } from 'vue';
|
|
||||||
>>>>>>> @{-1}:components/_util/props-util.js
|
|
||||||
import { camelize, hyphenate, isOn, resolvePropValue } from './util';
|
import { camelize, hyphenate, isOn, resolvePropValue } from './util';
|
||||||
import isValid from './isValid';
|
import isValid from './isValid';
|
||||||
// function getType(fn) {
|
// function getType(fn) {
|
||||||
|
|
Loading…
Reference in New Issue