DEV Community

Quick hack for using google translate (or other services) in Nuxt/Vue.js

Alexandru Bucur on May 26, 2018

Hey guys, here's a quick way of making google translate play nice using setInterval. export default { mounted: function() { this...
Collapse
 
lewiscowles1986 profile image
Lewis Cowles

Surely binding to onMutation event handler, then just initing on the root element is the way to go?

Collapse
 
coolgoose profile image
Alexandru Bucur

hey Lewis, sounds, interesting. How would you do it in that case ? I assume you're talking about MutationObservers right ?

Collapse
 
fezebr profile image
faezeh ebrahimy

hi
i use this code but i have this error in console:
index.vue?6ced:29 Uncaught ReferenceError: google is not defined

google in google.translate.TranslateElement