Answer the question
In order to leave comments, you need to log in
How to insert responsive ads in a Vue component?
Can't figure out how to do it. I connected vue-google-adsense, but the whole adaptive immediately floats, since the plugin does not accept all the parameters, which gives adsense. It is impossible to pick it up otherwise - vue swears at the direct embedding of scripts into the template. Or is there a way to put this code in scripts?
Answer the question
In order to leave comments, you need to log in
Make your own directive and paste it to the tag where you want to insert the ad: https://ru.vuejs.org/v2/guide/custom-directive.html
The directive will pass you the home element as soon as it is rendered and you can modify it , insert scripts and generally do whatever you want with it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question