本文整理匯總了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();
}
};