chore: prettier source code
This commit is contained in:
@@ -30,7 +30,7 @@ function gen(name: string, mods?: Mods): string {
|
||||
}
|
||||
|
||||
export function createBEM(name: string) {
|
||||
return function(el?: Mods, mods?: Mods): Mods {
|
||||
return function (el?: Mods, mods?: Mods): Mods {
|
||||
if (el && typeof el !== 'string') {
|
||||
mods = el;
|
||||
el = '';
|
||||
|
||||
@@ -43,7 +43,7 @@ export function unifySlots(context: RenderContext) {
|
||||
const scopedSlots = context.scopedSlots || context.data.scopedSlots || {};
|
||||
const slots = context.slots();
|
||||
|
||||
Object.keys(slots).forEach(key => {
|
||||
Object.keys(slots).forEach((key) => {
|
||||
if (!scopedSlots[key]) {
|
||||
scopedSlots[key] = () => slots[key];
|
||||
}
|
||||
@@ -66,7 +66,7 @@ function transformFunctionComponent(
|
||||
}
|
||||
|
||||
export function createComponent(name: string) {
|
||||
return function<Props = DefaultProps, Events = {}, Slots = {}>(
|
||||
return function <Props = DefaultProps, Events = {}, Slots = {}>(
|
||||
sfc: VantComponentOptions | FunctionComponent
|
||||
): TsxComponent<Props, Events, Slots> {
|
||||
if (isFunction(sfc)) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import locale from '../../locale';
|
||||
export function createI18N(name: string) {
|
||||
const prefix = camelize(name) + '.';
|
||||
|
||||
return function(path: string, ...args: any[]): string {
|
||||
return function (path: string, ...args: any[]): string {
|
||||
const messages = locale.messages();
|
||||
const message = get(messages, prefix + path) || get(messages, path);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ function assignKey(to: ObjectIndex, from: ObjectIndex, key: string) {
|
||||
}
|
||||
|
||||
export function deepAssign(to: ObjectIndex, from: ObjectIndex): ObjectIndex {
|
||||
Object.keys(from).forEach(key => {
|
||||
Object.keys(from).forEach((key) => {
|
||||
assignKey(to, from, key);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { deepAssign } from './deep-assign';
|
||||
|
||||
export function deepClone(obj: object): object {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(item => deepClone(item));
|
||||
return obj.map((item) => deepClone(item));
|
||||
}
|
||||
|
||||
if (typeof obj === 'object') {
|
||||
|
||||
@@ -43,7 +43,7 @@ export function emit(context: Context, eventName: string, ...args: any[]) {
|
||||
const listeners = context.listeners[eventName];
|
||||
if (listeners) {
|
||||
if (Array.isArray(listeners)) {
|
||||
listeners.forEach(listener => {
|
||||
listeners.forEach((listener) => {
|
||||
listener(...args);
|
||||
});
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ export function get(object: any, path: string): any {
|
||||
const keys = path.split('.');
|
||||
let result = object;
|
||||
|
||||
keys.forEach(key => {
|
||||
keys.forEach((key) => {
|
||||
result = isDef(result[key]) ? result[key] : '';
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ export function route(router: VueRouter, config: RouteConfig) {
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (promise && promise.catch) {
|
||||
promise.catch(err => {
|
||||
promise.catch((err) => {
|
||||
/* istanbul ignore if */
|
||||
if (err && err.name !== 'NavigationDuplicated') {
|
||||
throw err;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ function flattenVNodes(vnodes: VNode[]) {
|
||||
const result: VNode[] = [];
|
||||
|
||||
function traverse(vnodes: VNode[]) {
|
||||
vnodes.forEach(vnode => {
|
||||
vnodes.forEach((vnode) => {
|
||||
result.push(vnode);
|
||||
|
||||
if (vnode.children) {
|
||||
|
||||
Reference in New Issue
Block a user