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