lyb-js 1.6.32 → 1.6.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Browser/LibJsGetRowValue.d.ts +6 -0
- package/Browser/LibJsGetRowValue.js +10 -0
- package/README.md +964 -806
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @description 按点路径获取对象值
|
|
2
|
+
* @param row 数据对象
|
|
3
|
+
* @param prop 点路径属性
|
|
4
|
+
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsGetRowValue-按点路径获取对象值
|
|
5
|
+
*/
|
|
6
|
+
export const libJsGetRowValue = (row, prop) => {
|
|
7
|
+
return prop
|
|
8
|
+
.split(".")
|
|
9
|
+
.reduce((currentValue, key) => currentValue?.[key], row);
|
|
10
|
+
};
|