Created
April 9, 2020 03:55
-
-
Save teimur8/9157f52adb4512493ce9d27f478a269d to your computer and use it in GitHub Desktop.
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 characters
| // 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')}`); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment