本文整理匯總了TypeScript中@ephox/dom-globals.console類的典型用法代碼示例。如果您正苦於以下問題:TypeScript console類的具體用法?TypeScript console怎麽用?TypeScript console使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了console類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
const notifyTimeout = function (time) {
const notification = tinymce.activeEditor.notificationManager.open({
text: 'Timeout: ' + time,
timeout: time
});
console.log(notification);
};
示例2: return
onSetup: (api) => {
console.log('onSetup ' + name);
const box = Element.fromHtml('<div style="width: ' + width + 'px; background: ' + background + ';"></div>');
api.element().appendChild(box.dom());
return () => {
api.element().removeChild(box.dom());
};
},
示例3:
selector_converter: (selector, group) => {
console.log('selector', selector, 'group', group);
return {
title: selector + '.AdvGroup',
// NOTE: This is required so that it isn't disabled.
selector: 'p',
classes: selector.split('.')[1]
};
}
示例4: return
onSetup: (comp) => {
// debugger;
// TODO: TS narrowing, when config toggling = true
// then the comp interface should include comp.toggleOn otherwise it should complain
const state = DemoState2.get();
console.log(state);
comp.setActive(state);
return () => { };
},
示例5:
onSubmit: (api) => {
const data = api.getData();
// tslint:disable-next-line:no-console
console.log({
id: data.id
});
api.close();
}
示例6: function
const getCursorY = function (target) {
/* The y position on the cursor for the viewer is a combination of y position of the editor frame and the y
* y position of the target
*/
const editorY = iframe.dom().contentWindow.document.querySelector('iframe').getBoundingClientRect().top;
const targetY = target.dom().getBoundingClientRect().top;
// tslint:disable-next-line:no-console
console.log('editorY', editorY, 'targetY', targetY);
return editorY + targetY;
};
示例7:
onSubmit: (api) => {
const data = api.getData();
// Submit is only exectuted when the form has valid data
console.log({
code: data.color
});
api.close();
}
示例8:
onAction: (api, details) => {
if (details.name === 'char') {
// Would log '@' if the At sign is clicked these values doesn't have to be part of the state model
// tslint:disable-next-line:no-console
console.log({
char: details.value
});
api.close();
}
}
示例9:
onSubmit: (api) => {
const data = api.getData();
// tslint:disable-next-line:no-console
console.log({
language: data.language,
code: data.code
});
api.close();
}