Created
April 9, 2020 03:55
-
-
Save teimur8/9157f52adb4512493ce9d27f478a269d to your computer and use it in GitHub Desktop.
Revisions
-
teimur8 created this gist
Apr 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ // vue ingect export function injectFavorites(): void { const els: NodeListOf<Element> = document.querySelectorAll('.product-card__favorite-section'); if (els) { /* tslint:disable */ for (const i in els) { const el: Element = els[i]; if (el && el instanceof HTMLElement) { el.innerHTML = ''; new AddToFavorites({ store, propsData: { externalId: (el.getAttribute('id') as string).replace('external_id_', ''), viewPlace: (el.getAttribute('data-view-place')), }, }).$mount(`#${el.getAttribute('id')}`); } } } }