本文整理汇总了TypeScript中popper.js.default类的典型用法代码示例。如果您正苦于以下问题:TypeScript js.default类的具体用法?TypeScript js.default怎么用?TypeScript js.default使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了js.default类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: reposition
// Reposition the popup as it is shown or if its size changes
function reposition() {
const element = findDialogData();
if (element) {
if (popper) {
popper.scheduleUpdate();
} else {
const popperOptions = {
placement: 'top-start',
eventsEnabled: false,
modifiers: {
preventOverflow: {
priority: ['bottom', 'top', 'right', 'left']
},
flip: {
behavior: ['top', 'bottom', 'right', 'left']
},
offset: {
offset: '0,5px'
},
arrow: {
element: '.arrow'
}
}
} as any;
const boundariesElement = $attrs.itemPopupBoundaryClass
? document.getElementsByClassName($attrs.itemPopupBoundaryClass)[0]
: undefined;
if (boundariesElement) {
popperOptions.modifiers.preventOverflow.boundariesElement = boundariesElement;
popperOptions.modifiers.flip.boundariesElement = boundariesElement;
}
popper = new Popper(element, dialog[0], popperOptions);
popper.scheduleUpdate(); // helps fix arrow position
}
}
}
开发者ID:bhollis,项目名称:DIM,代码行数:39,代码来源:item-popup.directive.ts
示例2: Popper
import Popper from 'popper.js';
const reference = document.querySelector('.my-button');
const popper = document.querySelector('.my-popper');
const boundary = document.querySelector('.my-boundary');
const arrow = document.querySelector('.my-arrow');
const thePopper = new Popper(
reference,
popper,
);
thePopper.update();
thePopper.scheduleUpdate();
thePopper.destroy();
thePopper.enableEventListeners();
thePopper.disableEventListeners();
Popper.modifiers.forEach(console.log.bind(console));
Popper.placements.forEach(console.log.bind(console));
const thePopperWithOptions = new Popper(
reference,
popper,
{
placement: 'bottom',
eventsEnabled: true,
removeOnDestroy: true,
modifiers: {
shift: {
enabled: true,
fn: (data) => data,
开发者ID:DenisCarriere,项目名称:DefinitelyTyped,代码行数:31,代码来源:popper.js-tests.ts
示例3: Popper
import Popper from 'popper.js';
var reference = document.querySelector('.my-button');
var thePopper = new Popper(
reference, {
content: 'My awesome popper!'
}
);
thePopper.update();
thePopper.destroy();
var options = {
placement: 'bottom',
offset: 0,
arrowElement: document.querySelector('.arrow'),
modifiersIgnored: ['applyStyle'],
} as Popper.PopperOptions;
var thePopperWithOptions = new Popper(
reference, {
content: 'My awesome popper!',
}, options);
var popper = document.querySelector('.my-popper');
var anotherPopper = new Popper(
reference,
popper
);
var reference = document.querySelector('.my-button');
开发者ID:YousefED,项目名称:DefinitelyTyped,代码行数:30,代码来源:popper.js-tests.ts
注:本文中的popper.js.default类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论