Fix virtialReference --> virtualReference
This commit is contained in:
		| @@ -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, | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								index.js
									
									
									
									
									
								
							| @@ -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, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user