$(function initLanguageSwitcher() { var activeIcon = "/content/dam/corp/images/icons/language-selected.svg"; var nonActiveIcon = "/content/dam/corp/images/icons/language-not-selected.svg"; var LanguageSwitcher = { data: { languageListActive: false, languageIcon: nonActiveIcon }, methods: { toggleLanguageDropdown: function() { this.languageListActive = !this.languageListActive; this.languageIcon = this.languageListActive ? activeIcon : nonActiveIcon; } }, } $("#language-switcher").each(function () { new Vue(LanguageSwitcher).$mount(this) }) });