Skip to content

Commit

Permalink
fix(cdk:forms): fix review question
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownzjc committed Jan 13, 2022
1 parent a8f3ea2 commit de8f9c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cdk/forms/src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { ComputedRef, Ref, WatchCallback, WatchOptions, WatchStopHandle } f

import { computed, ref, shallowRef, watch, watchEffect } from 'vue'

import { isArray, isNil, isPlainObject } from 'lodash-es'
import { isArray, isNil, isPlainObject, isString } from 'lodash-es'

import { hasOwnProperty } from '@idux/cdk/utils'

Expand Down Expand Up @@ -544,7 +544,8 @@ export class FormControl<T = any> extends AbstractControl<T> {
}

getValue(): T {
return this.trim ? (this._valueRef.value as any).trim() : this._valueRef.value
const value = this._valueRef.value
return this.trim && isString(value) ? (value as any).trim() : value;
}

protected _forEachControls(_: (v: AbstractControl, k: never) => void): void {}
Expand Down

0 comments on commit de8f9c9

Please sign in to comment.