Class: MockModel

MockModel(baseElement, optsopt)

new MockModel(baseElement, optsopt)

Parameters:
Name Type Attributes Description
baseElement Document | Element
opts object <optional>
Source:

Methods

getData(expression, skipFnopt) → {*}

获取指定表达式对应元素的数据
Parameters:
Name Type Attributes Description
expression string | Array.<string> 表达式
skipFn function <optional>
判断是否跳过值,比如 (targetValue) => (targetValue == null)
Source:
Returns:
Type
*

setData(expression, value, notSkipSetIfValueAbsentopt)

设置指定表达式对应元素的数据
Parameters:
Name Type Attributes Default Description
expression string | Array.<string> 表达式
value *
notSkipSetIfValueAbsent boolean <optional>
false 是否跳过没有指定值的元素,默认 false 跳过没有指定值的元素
Source:

(static) getItemNames(data, expression) → {Array.<string>}

返回名称列表
Parameters:
Name Type Description
data Object
expression *
Source:
Returns:
Type
Array.<string>