dataset.get

最近更新时间:2023-01-09 17:45:16

我的收藏
dataset.get 能够根据给定的列名,获取参数文件中的数据值,主要在主函数中使用。
get(key: string): string

参数

参数
类型
描述
key
string
列名

返回

类型
描述
string
数据值

使用样例

获取参数文件中的数据值:
import dataset from 'pts/dataset';

export default function () {
// 获取 dataset 中列名为 'key1' 的数据值,假设值为 'value1'
const value = dataset.get('key1');
// 输出 'key1 => value1'
console.log(`key1 => ${value}`);
}