本文整理匯總了TypeScript中@ephox/sugar.Value類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Value類的具體用法?TypeScript Value怎麽用?TypeScript Value使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Value類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
Chain.op((element) => {
if (element.dom().type === 'checkbox') {
Assertions.assertEq(`The input value for ${label} should be: `, expected, element.dom().checked);
return;
}
Assertions.assertEq(`The input value for ${label} should be: `, expected, Value.get(element));
})
示例2:
Chain.op((element) => {
if (element.dom().type === 'checkbox') {
element.dom().checked = value;
return;
}
Value.set(element, value);
})
示例3: if
Chain.op((element) => {
if (element.dom().type === 'checkbox') {
Checked.set(element, value);
} else if (Node.name(element) === 'select' && typeof value === 'number') {
SelectTag.setSelected(element, value);
} else {
Value.set(element, value);
}
})
示例4:
Step.sync(() => {
Assertions.assertEq('Checking Value.get', '#header', Value.get(input.element()));
const repValue = Representing.getValue(input);
Assertions.assertEq('Checking Rep.getValue',
{
value: '#header',
meta: { text: 'Header1' }
},
{
value: repValue.value,
meta: { text: repValue.meta.text }
}
);
}),
示例5:
Chain.op((input) => {
Assertions.assertEq('Checking input value', 'C.Alpha', Value.get(input));
})
示例6:
Chain.op((elem) => {
Assertions.assertEq('Checking value of ' + selector, expected, Value.get(elem));
})
示例7:
Chain.op((element) => {
Assertions.assertEq(`The input value for ${Label} should be: `, expected, Value.get(element));
})