Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
set block(value: any) {
this._block = toBoolean(value);
}
private _block: boolean;
set last(value: any) {
this._last = toBoolean(value);
}
private _last: boolean;
set multiSort(value: any) {
if (typeof value === 'boolean' && !toBoolean(value)) {
this._multiSort = null;
return;
}
this._multiSort = {
...(typeof value === 'object' ? value : {}),
};
}
@Input()
set page(value: STPage) {
this.clonePage = value;
const item = deepMergeKey({}, true, new STConfig().page, this.cog.page, value);
const { total } = item;
if (typeof total === 'string' && total.length) {
this.totalTpl = total;
} else if (toBoolean(total)) {
this.totalTpl = this.locale.total;
} else {
this.totalTpl = '';
}
this._page = item;
}
/** 是否多排序,当 `sort` 多个相同值时自动合并,建议后端支持时使用 */
set grid(value: any) {
this._grid = toBoolean(value);
}
private _grid: boolean;
set noDefault(value: any) {
this._noDefault = toBoolean(value);
}
private _noDefault = false;
export function toBool(value: any, defaultValue: boolean) {
value = toBoolean(value, true);
return value == null ? defaultValue : value;
}