Fix virtialReference --> virtualReference
This commit is contained in:
parent
06b0cfc20a
commit
eb664afa8f
|
@ -44,7 +44,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
|
|||
shiftPadding: [8, 0],
|
||||
theme: 'light',
|
||||
trigger: 'mouseenter',
|
||||
virtialReference: undefined,
|
||||
virtualReference: undefined,
|
||||
zIndex: '',
|
||||
// Callback-функции, по-умолчанию не заданы
|
||||
onCreate(instance) {},
|
||||
|
@ -56,7 +56,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
|
|||
});
|
||||
```
|
||||
|
||||
##### virtialReference
|
||||
##### virtualReference
|
||||
|
||||
Настройка используется для кастомного позиционирования, ожидает объект с методом `getBoundingClientRect`.
|
||||
|
||||
|
@ -64,7 +64,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
|
|||
|
||||
```js
|
||||
createTooltip(document.querySelector('button'), 'Подсказка', {
|
||||
virtialReference: {
|
||||
virtualReference: {
|
||||
getBoundingClientRect() {
|
||||
return {
|
||||
x: 0,
|
||||
|
|
4
index.js
4
index.js
|
@ -26,7 +26,7 @@ export const createTooltip = ($el, content, options) => {
|
|||
shiftPadding: [8, 0],
|
||||
theme: 'light',
|
||||
trigger: 'mouseenter',
|
||||
virtialReference: undefined,
|
||||
virtualReference: undefined,
|
||||
zIndex: '',
|
||||
...options,
|
||||
};
|
||||
|
@ -167,7 +167,7 @@ export const createTooltip = ($el, content, options) => {
|
|||
const $arrow = $el._tooltip.$tooltip.querySelector('.tooltip__arrow');
|
||||
|
||||
const { x, y, placement, middlewareData } = await computePosition(
|
||||
options.virtialReference ?? $el,
|
||||
options.virtualReference ?? $el,
|
||||
$el._tooltip.$tooltip,
|
||||
{
|
||||
placement: options.placement,
|
||||
|
|
Loading…
Reference in New Issue