Fix virtialReference --> virtualReference

This commit is contained in:
Valentin Silytuin committed 2025-03-29 00:13:28 +04:00
1 parent 06b0cfc20a
commit eb664afa8f
2 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -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,
+2 -2
View File
@@ -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,