mazipan / vue-google-adsense

💰 Vue.js Google Adsense Component with InFeed and InArticle Ads support
https://mazipan.github.io/vue-google-adsense/
MIT License
257 stars 42 forks source link

Add a custom class to <ins> element #12

Closed airnichols13 closed 5 years ago

airnichols13 commented 5 years ago

Hello,

First of all, thanks for the component, it seems to work well.

I'm converting my non-Vue site to Vue, and am trying to set up my responsive ads. On the old site, I was able to manually add a class to the <ins> element which would apply my responsive CSS (it seems that's the only way to make ads responsive, according to the adsense site). Responsive styles applied in other ways seem to just get discarded by Adsense.

Which brings me to a potential feature-add: the option to pass a class through the <Adsense /> component to the <ins> element. I see there's :class="rootClass" already on the container element - it may be as easy as adding another on <ins> like <ins :class="insClass">.

Hopefully that makes sense.

Is that doable? Or is there another way?

mazipan commented 5 years ago

Sure, if you need that. It seems easy to implement. But now is sunday night in Jakarta. I will try to adding this new props as soon as possible.

Thanks 🙏

mazipan commented 5 years ago

Adding ins-class in the latest release 1.4.0 Let me know if still can not be used.

airnichols13 commented 5 years ago

I just tried to update to 1.4.0 and webpack is giving me this error when I build - did I miss something?:

ERROR in ./node_modules/vue-google-adsense/dist/vue-google-adsense.min.js Module not found: Error: Can't resolve 'vue-runtime-helpers/dist/normalize-component.js' in '...\node_modules\vue-google-adsense\dist'

mazipan commented 5 years ago

Maybe I have wrong Babel setup when build library. Let me hotfix, for now just downgrade to the before version.

mazipan commented 5 years ago

Updated to 1.4.2

airnichols13 commented 5 years ago

We're getting closer! Looks like it's working in "modern" browsers...

But I'm getting a "syntax error" in IE11 that I wasn't getting before with 1.3. I got this error once before on a different component because it wasn't getting transpiled.

Can you look at that too?

mazipan commented 5 years ago

Still looking for solutions 🤔

mazipan commented 5 years ago

Can you try to update version to 1.4.5 @airnichols13

airnichols13 commented 5 years ago

Looks good! Ads are showing up and IE11 loads.

Thanks again!

mazipan commented 5 years ago

You're welcome, don't forget to push 🌟 button ya @airnichols13

airnichols13 commented 5 years ago

You got it. Thanks!