添加 cl-form 组件
This commit is contained in:
@@ -166,7 +166,7 @@ export function get(object: any, path: string, defaultValue: any | null = null):
|
||||
* 设置对象的属性值
|
||||
* @example set({a: 1}, 'b', 2) // {a: 1, b: 2}
|
||||
*/
|
||||
export function set(object: any, key: string, value: any): void {
|
||||
export function set(object: any, key: string, value: any | null): void {
|
||||
(object as UTSJSONObject)[key] = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ref, type Ref } from "vue";
|
||||
import { forEach, forInObject, isArray, isObject, isString } from "./comm";
|
||||
|
||||
/**
|
||||
@@ -104,6 +105,21 @@ export const parseClass = (data: any): string => {
|
||||
return names.join(" ");
|
||||
};
|
||||
|
||||
/**
|
||||
* 将自定义类型数据转换为UTSJSONObject对象
|
||||
* @param data 要转换的数据
|
||||
* @returns 转换后的UTSJSONObject对象
|
||||
*/
|
||||
export function parseToObject<T>(data: T): UTSJSONObject {
|
||||
// #ifdef APP
|
||||
return JSON.parseObject(JSON.stringify(data)!)!;
|
||||
// #endif
|
||||
|
||||
// #ifndef APP
|
||||
return JSON.parse(JSON.stringify(data)) as UTSJSONObject;
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 将数值或字符串转换为rpx单位的字符串
|
||||
* @param val 要转换的值,可以是数字或字符串
|
||||
|
||||
Reference in New Issue
Block a user