Fix virtialReference --> virtualReference

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

View File

@ -44,7 +44,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
shiftPadding: [8, 0], shiftPadding: [8, 0],
theme: 'light', theme: 'light',
trigger: 'mouseenter', trigger: 'mouseenter',
virtialReference: undefined, virtualReference: undefined,
zIndex: '', zIndex: '',
// Callback-функции, по-умолчанию не заданы // Callback-функции, по-умолчанию не заданы
onCreate(instance) {}, onCreate(instance) {},
@ -56,7 +56,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
}); });
``` ```
##### virtialReference ##### virtualReference
Настройка используется для кастомного позиционирования, ожидает объект с методом `getBoundingClientRect`. Настройка используется для кастомного позиционирования, ожидает объект с методом `getBoundingClientRect`.
@ -64,7 +64,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', {
```js ```js
createTooltip(document.querySelector('button'), 'Подсказка', { createTooltip(document.querySelector('button'), 'Подсказка', {
virtialReference: { virtualReference: {
getBoundingClientRect() { getBoundingClientRect() {
return { return {
x: 0, x: 0,

View File

@ -26,7 +26,7 @@ export const createTooltip = ($el, content, options) => {
shiftPadding: [8, 0], shiftPadding: [8, 0],
theme: 'light', theme: 'light',
trigger: 'mouseenter', trigger: 'mouseenter',
virtialReference: undefined, virtualReference: undefined,
zIndex: '', zIndex: '',
...options, ...options,
}; };
@ -167,7 +167,7 @@ export const createTooltip = ($el, content, options) => {
const $arrow = $el._tooltip.$tooltip.querySelector('.tooltip__arrow'); const $arrow = $el._tooltip.$tooltip.querySelector('.tooltip__arrow');
const { x, y, placement, middlewareData } = await computePosition( const { x, y, placement, middlewareData } = await computePosition(
options.virtialReference ?? $el, options.virtualReference ?? $el,
$el._tooltip.$tooltip, $el._tooltip.$tooltip,
{ {
placement: options.placement, placement: options.placement,