本文整理汇总了TypeScript中@ephox/alloy.Form.getField方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Form.getField方法的具体用法?TypeScript Form.getField怎么用?TypeScript Form.getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/alloy.Form
的用法示例。
在下文中一共展示了Form.getField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}, (rgbForm) => {
Representing.setValue(rgbForm, {
hex: Option.from(m[1]).getOr('')
});
// So not the way to do this.
Form.getField(rgbForm, 'hex').each((hexField) => {
AlloyTriggers.emit(hexField, NativeEvents.input());
});
});
示例2:
const getCompByName = (access: DialogAccess<any>, name: string): Option<AlloyComponent> => {
// TODO: Add API to alloy to find the inner most component of a Composing chain.
const root = access.getRoot();
// This is just to avoid throwing errors if the dialog closes before this. We should take it out
// while developing (probably), and put it back in for the real thing.
if (root.getSystem().isConnected()) {
const form = Composing.getCurrent(access.getFormWrapper()).getOr(access.getFormWrapper());
return Form.getField(form, name).fold(() => {
const footer = access.getFooter();
const footerState = Reflecting.getState(footer);
return footerState.get().bind((f) => f.lookupByName(form, name));
}, (comp) => {
return Option.some(comp);
});
} else {
return Option.none();
}
};